Script Examples vbscript autoit php batch

Computer Member of AD Group

(0)
Artikel
bewerten
(1)

Script vor testing the Membership of an Computer in an Active Directory Group

This script looks if the Computer running on it is in an specified Active Directory Group: (in this Example: ActiveDirectoryGroup1 or ActiveDirectoryGroup2)

Dim WSHShell, objNET, objSysInfo, objComputer, strComputerDN, strGroups, Group, GroupName
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set objNET = WScript.CreateObject("WScript.Network")
Set objSysInfo = WScript.CreateObject("ADSystemInfo")
strComputerDN = objSysInfo.COMPUTERNAME
Set objComputer = GetObject("LDAP://" & strComputerDN)  
  
strGroups = objComputer.GetEx("memberOf")  
For Each Group in strGroups
Set ThisGroup = GetObject("LDAP://" & Group)
GroupName = ThisGroup.CN

Select Case GroupName
   Case "ActiveDirectoryGroup1"
Wscript.echo "Group1"
WScript.Quit(0)
   Case "ActiveDirectoryGroup1"
        Wscript.echo "ActiveDirectoryGroup2"
End Select
Next
<<< cmd vbscript delete subdirectories and files with error level vbscript - Access (mdb) Datei generieren >>>


neue Themen

Stichwortsuche auf dieser Seite:
03.09.2010 16:03 zZ 16 Leser online
Powered by cms.libe.net 2004-2010