Page 1 of 1 1
Topic Options
#133196 - 2005-02-01 12:29 AM dial-in properties
briannz556 Offline
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
#133197 - 2005-02-01 01:03 AM Re: dial-in properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
http://support.microsoft.com/Default.aspx?kbid=252398
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133198 - 2005-02-01 01:09 AM Re: dial-in properties
briannz556 Offline
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
#133199 - 2005-02-01 01:14 AM Re: dial-in properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Did you try doing it in VBS? Anytime I try converting VBS code, I always verify that the original VBS I am trying to convert works.

Is this NT4 or AD? There is a LDAP method too.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133200 - 2005-02-01 01:31 AM Re: dial-in properties
briannz556 Offline
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 Offline
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 Offline
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
#133203 - 2005-02-01 03:57 AM Re: dial-in properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I would try the .put method.

$douser.put 'msNPAllowDialin',1
$douser.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
#133204 - 2005-02-01 04:04 AM Re: dial-in properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Come to think of it, maybe:

$douser.put('msNPAllowDialin',-1)
$douser.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
#133205 - 2005-02-02 03:22 AM Re: dial-in properties
briannz556 Offline
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
#133206 - 2005-02-02 05:16 PM Re: dial-in properties
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
"msNPAllowDialin" Attribute Works Only in Native Mode

BUG: WTSSetUserConfig() May Modify a User's Remote Access Permission

msNPAllowDialin - scripting "Allow dial-in access"

Quote:

Matt May 2 2001, 1:02 pm show options

Newsgroups: microsoft.public.active.directory.interfaces
From: "Matt" <mjan...@kodiakcomputer.com> - Find messages by this author
Date: Wed, 2 May 2001 15:59:30 -0400
Local: Wed, May 2 2001 12:59 pm
Subject: Re: msNPAllowDialin - scripting "Allow dial-in access"
Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse

I was setting msNPAllowDialin to "True", "yes" or 0, none o­f which were
working.
True without quotes did it.




_________________________
Home page: http://www.kixhelp.com/hb/

Top
#133207 - 2005-02-02 05:35 PM Re: dial-in properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well... I have no problem to set it using a subset of the VBS code I posted. I just have not converted it to KiX.
VBS Code:
Set objUser = GetObject ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")
objUser.Put "msNPAllowDialin", TRUE
objUser.SetInfo


Brian,
Have you tried using VBS?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133208 - 2005-02-03 10:31 PM Re: dial-in properties
briannz556 Offline
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
#133209 - 2005-02-04 02:06 AM Re: dial-in properties
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Brian,

In Kixtart, to specify a true TRUE, you have to do a bit of reverse boolean psychology, try this ...

$douser.put('MsNPAllowDialin', NOT 0)

where NOT 0 evaluates to TRUE .. if this works, make sure to kick the ADSI developers ass, because its bad design/form on their part.

Top
#133210 - 2005-02-04 02:34 AM Re: dial-in properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Thanks Shawn. I knew I could use NOT 0 in an IF condition as in:

IF $Bla = NOT 0

but never thought to use it in a PUT.

BTW, I tested it on my AD and it worked.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133211 - 2005-02-06 10:31 PM Re: dial-in properties
briannz556 Offline
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
#133212 - 2005-02-06 11:15 PM Re: dial-in properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Not quite...
True = NOT 0
False = NOT 1
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133213 - 2005-02-07 03:27 AM Re: dial-in properties
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I agree, @TRUE and @FALSE macro's would be a great addition to the Kixtart scripting language.
Top
#133214 - 2005-04-01 11:28 PM Re: dial-in properties
chewy Offline
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
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.056 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org