anding
Goto Top

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...

Content-Key: 45159

Url: https://administrator.de/contentid/45159

Printed on: April 19, 2024 at 09:04 o'clock

Member: superboh
superboh Apr 05, 2007 at 21:22:58 (UTC)
Goto Top
Hi,

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