Const Enabled = 1
I am trying to set terminal services properties on a user account using the following code:
Const Enabled = 1
Const Disabled = 0
Set objUser = GetObject _
("LDAP://cn=Ben Hughes,ou=General Users,ou=Company Users,dc=company,dc=com")
objUser.TerminalServicesProfilePath = "\\server\share$\bhughes"
objUser.TerminalServicesHomeDirectory = "\\server\bhughes$"
objUser.TerminalServicesHomeDrive = "V:"
objUser.AllowLogon = Enabled
objUser.SetInfo
I get a runtime error 800A01B6 on each of the objUser methods, yet I can't see anything wrong with them. I had sytax errors in the LDAP line which threw up messages about not being able to find the object, so i know that line was ok once I had fixed it.
I have put this code into excel to debug and as I step through it, the objUser variable doesnt contain any data.
Can anyone help?
Thanks
I am trying to set terminal services properties on a user account using the following code:
Const Enabled = 1
Const Disabled = 0
Set objUser = GetObject _
("LDAP://cn=Ben Hughes,ou=General Users,ou=Company Users,dc=company,dc=com")
objUser.TerminalServicesProfilePath = "\\server\share$\bhughes"
objUser.TerminalServicesHomeDirectory = "\\server\bhughes$"
objUser.TerminalServicesHomeDrive = "V:"
objUser.AllowLogon = Enabled
objUser.SetInfo
I get a runtime error 800A01B6 on each of the objUser methods, yet I can't see anything wrong with them. I had sytax errors in the LDAP line which threw up messages about not being able to find the object, so i know that line was ok once I had fixed it.
I have put this code into excel to debug and as I step through it, the objUser variable doesnt contain any data.
Can anyone help?
Thanks