Befehl nur für bestimme Organisationseinheit ausführen (Kixtart)
Hallo NG!
Gibts eine Möglichkeit in Kix einen Befehl nur für eine bestimmt OU vom AD ausführen zu lassen?!
wie
If InGroup ("")
nur halt
If inOU ("***")
Danke schon mal...
Gibts eine Möglichkeit in Kix einen Befehl nur für eine bestimmt OU vom AD ausführen zu lassen?!
wie
If InGroup ("")
nur halt
If inOU ("***")
Danke schon mal...
Please also mark the comments that contributed to the solution of the article
Content-Key: 45159
Url: https://administrator.de/contentid/45159
Printed on: April 25, 2024 at 17:04 o'clock
1 Comment
Hi,
ich hab vor einiger Zeit mal zwei Funktionen gefunden, mit der man die jeweilige OU bestimmen kann, vielleicht hilft es Dir ja:
Gruß,
Thomas
ich hab vor einiger Zeit mal zwei Funktionen gefunden, mit der man die jeweilige OU bestimmen kann, vielleicht hilft es Dir ja:
Function GetComputerOU()
ReDim $TempArray
ReDim $GetComputerOU
$adSys = CreateObject("ADSystemInfo")
$TempArray = Split($adSys.ComputerName,",")
; Check if there's a comma in the CN, eg if the user name = "Surname, Name" AD returns "Surname\, Name"
If Right($TempArray,1) = "\"
$Start = 2
Else
$Start = 1
EndIf
For $Counter = $Start To Ubound($TempArray)
If Len($GetComputerOU) = 0
$GetComputerOu = $TempArray[$Counter]
Else
$GetComputerOu = $GetComputerOu + "," + $TempArray[$Counter]
EndIf
Next
$adSys = 0
EndFunction GetComputerOU()
Function GetUserOU()
ReDim $TempArray
ReDim $GetUserOU
$adSys = CreateObject("ADSystemInfo")
$TempArray = Split($adSys.UserName,",")
; Check if there's a comma in the CN, eg if the user name = "Surname, Name" AD returns "Surname\, Name"
If Right($TempArray,1) = "\"
$Start = 2
Else
$Start = 1
EndIf
For $Counter = $Start To Ubound($TempArray)
If Len($GetUserOU) = 0
$GetUserOu = $TempArray[$Counter]
Else
$GetUserOu = $GetUserOu + "," + $TempArray[$Counter]
EndIf
Next
$adSys = 0
EndFunction GetUserOU()
Gruß,
Thomas