Python PyAD setting multiple workstations during creation of user

183 Views Asked by At

Trying to add multiple workstations using pyad. I am able to set a single workstation, but not multiple workstations.

from pyad import aduser

ou = pyad.adcontainer.ADContainer.from_dn(
  "ou=someplace, DC=domain, DC=com")
new_user=pyad.aduser.ADUser.create(
      "test02", ou, password="password123",
       optional_attributes= 
       {'userWorkstations':
        'computer1','computer2'}) 

I've also tried using ldap3 with the same result. It completes the operation, but when looking in Active Directory, it only sets the first workstation.

1

There are 1 best solutions below

0
On BEST ANSWER

after looking at the ADSI editor in Active Directory, I found my mistake.

'userWorkstations' :"computer1,computer2"

my mistake was that I had a space after the comma. Thank-you for everyone's assistance.