Unable to Add a User to Group


hello, trying add user security group using script below. however, getting type mismatch. thoughts on doing wrong? using ad 2003

$groupurl = "ldap://localhost/cn=my-group,ou=corp_w2k3,dc=idam,dc=com"

$group = new-object system.directoryservices.directoryentry($groupurl, "localadmin", "password@123")

$group | get-member

$userurl = "ldap://localhost/cn=t117,ou=corp_w2k3,dc=idam,dc=com"

$user = new-object system.directoryservices.directoryentry($userurl, "localadmin", "password@123")

$group.add($user)

 

thanks help

try this:

$group.add($userurl)



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file