#133196 - 2005-02-01 12:29 AM
dial-in properties
|
briannz556
Getting the hang of it
Registered: 2002-05-03
Posts: 64
Loc: new zealand
|
Hi There Was wondering if some kind soul could help me?
browsed all i could find on setting the property of a W2000 user in AD to enable them to dial-in to our school network.
The function dial-in() below produces no errors but there again doesn't work:
Function DialIn() $douser = GetObject("WinNT://" + @domain + "/" + $username + ",user") If @error Stop(12,'Dialin path issue') Else MessageBox('made it','Hmmm') $douser.dialinprivilege=1 $douser.SetInfo If @ERROR MessageBox(@ERROR,'Error') EndIf EndIf EndFunction
Could someone point me in the right direction please?
Many thanks
|
|
Top
|
|
|
|
#133198 - 2005-02-01 01:09 AM
Re: dial-in properties
|
briannz556
Getting the hang of it
Registered: 2002-05-03
Posts: 64
Loc: new zealand
|
Thanks for that Les. Been there and done that too i.e registered adsras.dll.
Still flumaxed.
|
|
Top
|
|
|
|
#133200 - 2005-02-01 01:31 AM
Re: dial-in properties
|
briannz556
Getting the hang of it
Registered: 2002-05-03
Posts: 64
Loc: new zealand
|
AD Les. I'm not a VB person so didn't try that. Also, reading suggested to me it had to be Winnt and NOT Ldap to work. But, i'm often wrong on such matters LOL.
|
|
Top
|
|
|
|
#133201 - 2005-02-01 01:57 AM
Re: dial-in properties
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
That MS KB is a work-around for NT4... There is a LDAP method that is different. Here is some VBS Code:
Const ADS_PROPERTY_UPDATE = 2 Set objUser = GetObject _ ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") objUser.Put "msNPAllowDialin", TRUE objUser.PutEx ADS_PROPERTY_UPDATE, _ "msNPSavedCallingStationID", Array("555-0100", "555-0111") objUser.PutEx ADS_PROPERTY_UPDATE, _ "msNPCallingStationID", Array("555-0100", "555-0111") objUser.Put "msRADIUSServiceType", 4 objUser.Put "msRADIUSCallbackNumber", "555-0112" objUser.Put "msRASSavedFramedIPAddress", 167903442 objUser.Put "msRADIUSFramedIPAddress", 167903442 'value of 10.2.0.210 objUser.PutEx ADS_PROPERTY_UPDATE, _ "msRASSavedFramedRoute", _ Array("10.1.0.0/16 0.0.0.0 1", "192.168.1.0/24 0.0.0.0 3") objUser.PutEx ADS_PROPERTY_UPDATE, _ "msRADIUSFramedRoute", _ Array("10.1.0.0/16 0.0.0.0 1", "192.168.1.0/24 0.0.0.0 3") objUser.SetInfo
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.
|
|
Top
|
|
|
|
#133202 - 2005-02-01 03:48 AM
Re: dial-in properties
|
briannz556
Getting the hang of it
Registered: 2002-05-03
Posts: 64
Loc: new zealand
|
Ok, read that and tried:
$douser = GetObject("LDAP://cn=" + $UserName + "," + $LDAPpath) If @ERROR MessageBox(@ERROR, '1') EndIf MessageBox("LDAP://cn=" + $UserName + "," + $LDAPpath,'2') $douser.msNPAllowDialin=1 $douser.SetInfo If @ERROR MessageBox(@ERROR, '3') EndIf
Messagebox 1 never appeared - good Messagebox 2 gave the correct string - good Messagebox 3 gave error = -2147352567 which means The storage control block is invalid.
Feel I'm possibly doing something wrong setting the radio button value but not sure what.
Any clues would be appreciated.
Thanks
|
|
Top
|
|
|
|
#133205 - 2005-02-02 03:22 AM
Re: dial-in properties
|
briannz556
Getting the hang of it
Registered: 2002-05-03
Posts: 64
Loc: new zealand
|
Sorry Les, tried those values: 1 and -1 using put but to no avail eg $douser.put('msNPAllowDialin',1) and $douser.put('msNPAllowDialin',-1)
Still get messagebox 3 as per previous description.
|
|
Top
|
|
|
|
#133208 - 2005-02-03 10:31 PM
Re: dial-in properties
|
briannz556
Getting the hang of it
Registered: 2002-05-03
Posts: 64
Loc: new zealand
|
Many thanks for that Howard.
I read doc and switched to Native mode which opened up 3 radio buttons in the Dialin property: Allow access, deny access and control access through RAP (which was greyed out in Mixed mode).
However, all variations on $douser.put('MsNPAllowDialin',?) with ? being 0, 1, -1, true, 'true', '1' etc still give the same messagebox 3 error message with Control Access Through RAP being the option selected.
|
|
Top
|
|
|
|
#133211 - 2005-02-06 10:31 PM
Re: dial-in properties
|
briannz556
Getting the hang of it
Registered: 2002-05-03
Posts: 64
Loc: new zealand
|
Magic. Works a treat.
I did search Google for "ADSI developers [censored]" but too many hits to be able to contact the right person ;-)
Anyway, I was wondering if this issue of true/false needs tidying up for newbies like myself. @true = NOT 0 and @False = 0 would seems to fit VB translation and reduce the number of issues this causes. Just a thought.
Appreciate expert input.
|
|
Top
|
|
|
|
#133214 - 2005-04-01 11:28 PM
Re: dial-in properties
|
chewy
Just in Town
Registered: 2003-10-06
Posts: 4
Loc: TX, USA
|
I was able to use the dialinprivilege property mentioned in the MS KB article to toggle the settings. Here are the code: $User = GetObject("WinNT://"+$Domain+"/"+$Userid) $User.DialinPrivilege = -1 $RC = $User.SetInfo
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|