I want to create a new group in my Active directory using the following script:
$DomainName=EUROPE.fs.mydomain.com $ADsPath="LDAP://OU=Groups,OU=DE,DC=europe,DC=FS,DC=mydomain,DC=com"
CreateGroup("GDEUTest","Testgruppe")
Function CreateGroup($GRPName, $description)
$OUObj = GetObject($ADsPath) $UserObj = $OU.Create("Group","cn=$GRPName") $UserObj.Put ("description", $description) $UserObj.Put ("sAMAccountName", $GRPName) $UserObj.SetInfo
; Objects cleanup $UserObj = 0 $OUObj = 0
EndFunction
Whenever I run it I get this error:
ERROR : expected ')'!
which shall be in this line: $UserObj = $OU.Create("Group","cn=$GRPName")
I cannot find the error. Can anyone help ?
|