I am trying to update 3500 accounts to add the User Principal names for them with no luck. Below is the code that I am trying to use
Const ADS_PROPERTY_UPDATE = 2
Set User = GetObject("LDAP://CN=magnus,OU=Network,OU=IT,OU=Information Technology,OU=Users and Groups,DC=mycompany,DC=net")
User.Put "userPrincipalName", "magnus"
When I run the above I get the followong error
C:\Support\UPNs\upn.vbs(3, 1) (null): A referral was returned from the server