NetworkGeezer Posted November 16, 2006 Posted November 16, 2006 The new DS* commands in Windows 2003 (DSAdd, DSMod etc) are great by they rely on referring to users by common names (CNs). I guess it's because users are just one other AD object type. My problem is that I like to operate on users wherever OU they are rather than specifying the full CN. For students I can normally derive the username from MIS data but CNs are suceptible to changes in spelling or movements in teaching/tutor groups. Any ideas? Should I DSQuery to get the CNs then match to the username field and then peform the DSMod with CN?
ChrisH Posted November 16, 2006 Posted November 16, 2006 Using ADSI scripting you can pull an object from AD with two methods using the LDAP provider or the WinNT. With the LDAP you have to specify the full CN eg GetObject("LDAP://cn=blah,cn=blah") But with the WinNT you can use a simpler format eg: Set ObjUser = GetObject("WinNT://yourdomain/username","user")
NetworkGeezer Posted November 16, 2006 Author Posted November 16, 2006 The WinNT provider seems good. Actually I was hoping to do it with just using shell commands but ADSI may be the way to go.
Wiseman82 Posted November 16, 2006 Posted November 16, 2006 Two methods to get the DN from the Pre Windows 2000 Logon Name (sAMAccoutName): http://www.wisesoft.co.uk/Scripts/display_script.aspx?id=118 http://www.wisesoft.co.uk/Scripts/display_script.aspx?id=23 Hope this helps, David
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now