Sign in to follow this  
Followers 0
bourny

Workgroup.

10 posts in this topic

Can anyone think of a way of detecting a workgroup name ....

I can use @logondomain or @logondnsname to pick up Domain but not workgroup.

Basically I want to prevent my script running outside od 1 named domain and 1 named workgroup,.

Thanks

Bourny

Share this post


Link to post
Share on other sites



Can anyone think of a way of detecting a workgroup name ....

I can use @logondomain or @logondnsname to pick up Domain but not workgroup.

Basically I want to prevent my script running outside od 1 named domain and 1 named workgroup,.

Thanks

Bourny

Instead of running it against the name of the Domain/Workgroup, why dont you have the script authenticate based on the Windows SID of the user?

-Blademonkey


---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

No good registering against sid of user as this brings too many variables and is subject to changing. I need to keep this as simple as above - Only work on 1 named workgroup and 1 named domain.

Share this post


Link to post
Share on other sites

Can anyone think of a way of detecting a workgroup name ....

I can use @logondomain or @logondnsname to pick up Domain but not workgroup.

Basically I want to prevent my script running outside od 1 named domain and 1 named workgroup,.

Thanks

Bourny

If NetBIOS is up, then this DOS command will show workgroup:

REM Display all NetBIOS records
nbtstat -n

REM Display only workgroup record (same as domain name to NetBIOS)
nbtstat -n | find /i "<00>  GROUP"

I'm not sure what the slickest way is to get that text back into an AutoIT string, any hints?

:lmao:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

If NetBIOS is up, then this DOS command will show workgroup:

REM Display all NetBIOS records
nbtstat -n

REM Display only workgroup record (same as domain name to NetBIOS)
nbtstat -n | find /i "<00>  GROUP"

I'm not sure what the slickest way is to get that text back into an AutoIT string, any hints?

:lmao:

StdOutRead() ?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

StdOutRead() ?

Yeah, I saw that before... problem is, it's Beta only. I have to stick to Prod until I get a bug with GuiCtrlCreateButton figured out. Looks like redirect to a file and read it from there for now.

Thanks for trying though.

:lmao:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Yeah, I saw that before... problem is, it's Beta only. I have to stick to Prod until I get a bug with GuiCtrlCreateButton figured out. Looks like redirect to a file and read it from there for now.

Thanks for trying though.

:lmao:

what is the bug with GuiCtrlCreateButton?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

what is the bug with GuiCtrlCreateButton?

No exactly bugs. Resolved in this thread: Combo Box Options Not Pulled Down

I had a perfect storm of problems with a script that was very dependant on Prod vs. Beta in its symptoms.

All solved with the excelent support from this forum! ;)

There are two parts I might call "bugs":

One is that installing Beta overwrites your Prod include files. The Gurus are working that issue, and don't consider it a bug. You can use F5 or Alt-F5 to run, and Ctl-F7 or Alt-F7 to compile, in Prod or Beta from SciTE. But with the Prod include files overwritten with Beta versions some things don't work in Prod any more (Array.au3 in my case).

The second one is that when creating a Combo Box using GuiCtrlCreateCombo() the pull down list doesn't display unless a control height of at least 100 is assigned. This seems to be OS dependant, presenting in 2000 but not XP. I'm not sure what status is on fixing that, but the workaround is easy.

The last part of the problem, with GuiCtrlCreateButton, was with unexpected symptoms of a coding error on my part, again dependant on Prod vs. Beta. In earlier lines creating the GUI, I meant to enable pasting information into some Input Boxes. I put in GuiSetState() instead of GuiCtrlSetState() to do it. In Prod, the bad lines were ignored and did nothing, not producing any error. In Beta the bad lines caused a funky state in the GUI that would not allow the Buttons to be created later on. The Buttons failed to create and returned a ContolID = 0, but the actual problem was several lines earlier, and depended on Prod vs Beta versions.

Very educational for me at the least! :lmao:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

New answer -- I posted two UDFs: _GetWorkgroup() and _GetWorkgroupList() in the following thread:

_GetWorkgroup and _GetWorkgroupList

Enjoy! :lmao:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

There are two parts I might call "bugs":

You might but we don't and this is why:

One is that installing Beta overwrites your Prod include files. The Gurus are working that issue, and don't consider it a bug. You can use F5 or Alt-F5 to run, and Ctl-F7 or Alt-F7 to compile, in Prod or Beta from SciTE. But with the Prod include files overwritten with Beta versions some things don't work in Prod any more (Array.au3 in my case).

This was by design. It was a poor design, but it was by design. As you've already noted, this is being worked on.

The second one is that when creating a Combo Box using GuiCtrlCreateCombo() the pull down list doesn't display unless a control height of at least 100 is assigned. This seems to be OS dependant, presenting in 2000 but not XP. I'm not sure what status is on fixing that, but the workaround is easy.

Well, given that the this is in the documentation, this is definitely not a bug and it's nobodies fault but your own that you had problems with this. The documentation clearly states that there is a difference in behavior on different versions of Windows and that the solution is to specify a larger size.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0