#67164 - 2002-06-17 08:02 PM
Re: InContainer Script
|
joewilson
Lurker
Registered: 2002-06-17
Posts: 3
Loc: Stamford
|
I implemented Howard Bullock's suggestion and that certainly does give me the user DN. Now my problem is that I am using blat.exe to generate the email to the Help Desk and cannot successfully pass the $DN variable to the email. Here is the code from the login script. Below is the code from the batch file being called.
$DN = TranslateName (3, "", 3, "@LDomain\@UserId", 1)? "DN = " + $DN[0]? "Error = " + $DN[1]? "ErrorText = " + $DN[2]
;$rc = InContainer ("OU=Test,OU=Stamford,DC=us01,DC=apmn,DC=org", "Computer") ;Gosub "Output" ;$rc = InContainer ("OU=OU=Workstations,OU=IT,OU=Stamford,DC=us01,DC=apmn,DC=org", "Computer") ;Gosub "Output" $rc = InContainer ("CN=Computers,DC=us01,DC=apmn,DC=org", "Computer") Gosub "Output" exit
:Output select case $rc[0]=1 shell "%comspec% /c @ldrive\computers.bat @wksta " + $DN[0] case $rc[0]=2 shell "%comspec% /c @ldrive\computers.bat @wksta @userid" case $rc[0]=0 ;? "object is NOT a member of this container or a child of this container." case 1 ? "Error" endselect return
;------------------------------------------------------------------------------------------ Function InContainer ($Container, $NameType) Dim $Container, $CurrentContainer, $NameType, $Name1, $Name2 select case $NameType = "Computer" $Name1 = "@Domain\@wksta$" case $NameType = "User" $Name1 = "@LDomain\@UserID" case 1 $Name1 = "" endselect
Here is the code from the batch file
%0\..\blat.exe %0\..\mailtext.txt -t joseph.wilson@pharma.com -s "Computer in the Computers OU (PC:%1 User:%2)" -f LoginScript@pharma.com - server mail
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 918 anonymous users online.
|
|
|