Page 1 of 1 1
Topic Options
#133118 - 2005-01-28 04:21 PM Problems retrieving GUID's from wksta's using GetGUID()
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
We are switching to a complete new network for our entire company.
Jumping from the old NT4 servers to Win2K3 with AD we will be using RIS to install all our clients. To pre-stage all the clients in AD it's is required to fill in a GUID (or a MAc based GUID but I prefer the real GUID) when creating a computer account that is managed.

To get all the GUID's from all workstations we creatd the script bellow, the GetGUID() GetGUID() udf is required.

On cleints running Win2K pro sp2 explorer.exe seems to hang when we run the script. Changed the script to check if a system is sp2 or not and return a MAC address based GUID if sp2 or older. This also hangsup explorer.exe. On Win2K sp4 all is oke. Explorer.exe version on sp2 clients is 5.0.3315.2846.

Anybody seen this before?

Code:

$resultsfile = Exist ("\\rotsvr02\logs\guids\" + @WKSTA + ".log")
$wksta = @WKSTA
$date = @DATE
$time = @TIME
$userid = @USERID
$lserver = @LSERVER
$mac = @ADDRESS

;Get serialnumber
Dim $wmiRoot, $wmiColl, $wmiObj
$wmiRoot = GetObject("WinMgmts:root/cimv2")
$wmiColl = $wmiRoot.ExecQuery("Select * FROM Win32_BIOS")

For Each $wmiObj in $wmiColl
$SerialNumber = $wmiObj.SerialNumber
Next

Select
Case $resultsfile = "0"
;Get guid
Call $lserver + "\netlogon\functions\GetGUID.udf"
$guid = GetGUID()
$rc = Open(1, "\\rotsvr02\logs\guids\" + @WKSTA + ".log",5)
$rc = WriteLine (1, "Workstation name: " + $wksta + @CRLF)
$rc = WriteLine (1, "Serialnumber: " + $serialnumber + @CRLF)
$rc = WriteLine (1, "GUID: {" + $guid + "}" + @CRLF)
$rc = WriteLine (1, "Date and : " + $date + " -- " + $time + @CRLF)
$rc = WriteLine (1, "UserID: " + $userid + @CRLF)
$rc = Close (1)
Case $resultsfile = "1"
;File allready exists.
EndSelect

_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#133119 - 2005-01-30 02:24 AM Re: Problems retrieving GUID's from wksta's using GetGUID()
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Print out error codes after each code line and step through the script to figure out which line is failing and why.
_________________________
There are two types of vessels, submarines and targets.

Top
#133120 - 2005-01-30 05:23 PM Re: Problems retrieving GUID's from wksta's using GetGUID()
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Did this already, gives error 0 on each line.

The script seems to complete correctly because the next script is called from the master script and call waits for the first script to complete before calling the next script right?

It does actually write the file with all requested data in it.


Edited by R2D2 (2005-01-30 05:26 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#133121 - 2005-01-30 05:29 PM Re: Problems retrieving GUID's from wksta's using GetGUID()
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
We will be doing some admin work in the evening hours shortly before changing to the new network.
Maybe I should just include this script and let the wksta reboot when done, everything is ok when I reboot after running the script. It only runs once (as it should do).
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 320 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.124 seconds in which 0.096 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org