I have been struggling over this all day and I'm about to throw my computer out the window. I am trying to create a script to modify the User Dial-In properties, which has to be done with LDAP. I can modify it to "True" (allow)or "False" (deny) without a problem... but of course the one I need to set it to "EMPTY" (aka: Control Access Through Remote Access Policy) does not work. Every Microsoft TechNet, MSDN and example I have found says to do it this way:
UsrObj.Put "msNPAllowDialin", EMPTY
When I do that I get:
Error: Unspecified Error
Code: 80004005
Source: (null)
I've tried everything, and nothing seems to work. Has anyone done this successfully?
My Code:
========
Set UsrObj = GetObject("LDAP://CN=Schmoe Joe, OU=Users,DC=Microshaft,DC=COM")
'echo current setting
wscript.echo UsrObj.msNPAllowDialin & vbcrlf
' Set RAS Option
UsrObj.Put "msNPAllowDialin", EMPTY
'Apply RAS Option
UsrObj.SetInfo
'echo to check changes
wscript.echo UsrObj.msNPAllowDialin & vbcrlf
UsrObj.Put "msNPAllowDialin", EMPTY
When I do that I get:
Error: Unspecified Error
Code: 80004005
Source: (null)
I've tried everything, and nothing seems to work. Has anyone done this successfully?
My Code:
========
Set UsrObj = GetObject("LDAP://CN=Schmoe Joe, OU=Users,DC=Microshaft,DC=COM")
'echo current setting
wscript.echo UsrObj.msNPAllowDialin & vbcrlf
' Set RAS Option
UsrObj.Put "msNPAllowDialin", EMPTY
'Apply RAS Option
UsrObj.SetInfo
'echo to check changes
wscript.echo UsrObj.msNPAllowDialin & vbcrlf