ADSI Question 
Author Message
 ADSI Question

No, but several threads here in the last two days have addressed that issue.

--
Mark L. Ferguson  Please reply in newsgroup
marfers notes for OE5 >   http://www.*-*-*.com/

Quote:

> Hi all,
>     I'd like to start creating user accounts using ADSI/WSH scripts and/or ADSI in VB. I can find most of the information I need to do this, however I cannot find how to set the the actual Drive Letter used for the Home Directory. I can set the path but not the Drive Letter. Anyone know how to do this?

>     And/all help is appreciated.

> --
> Tim Munro, Network Specialist
> Computing & Communications Services, Carleton University

>            * System error, strike any user to continue... *

[ Attached Message ]

From:
To:
Date: Tue, 21 Mar 2000 14:01:18 -0600
Local: Tues, Mar 21 2000 3:01 pm
Subject: Re: setting the working directory before shell.Run()
There are several threads here about changing the default folder for WSH. One way I see to do what you want, (since the default folder for any command run in the host is the folder that the host script is started in,) is to use OpenTextFile ( )  to create a new wsf file (in dir1) with a run command for 'cmd1',  and create a second wsf (in dir2) with a run command for 'cmd2', finally running both wsf files from the original wsf, then a delete for both temp wsf's. As I see it, you could accept arguments in the primary wsf for the dir's and cmd's.

--
Mark L. Ferguson  Please reply in newsgroup
marfers notes for OE5 >   http://www.*-*-*.com/

- Show quoted text -

Quote:

> I'm using the Run method of the Wscript.Shell object to execute a series of
> commands.  Each command must be executed in a different working directory.
> In a batch file I would do something like this:

>     cd dir1
>     cmd1
>     cd dir2
>     cmd2
>     (etc.)

> Does WSH provide a way to do this?  I'm using jscript as the scripting
> language, by the way.

> Any insights would be appreciated.

> Clint Foster



Sun, 08 Sep 2002 03:00:00 GMT  
 ADSI Question

Take a look at the adsiFAQ on my site....

http://cwashington.netreach.net/script_repository/faqs.asp?topic=adsifaq

--
Clarence

Win32Scripting....
No, not that other one..... THE ORIGINAL...
http://cwashington.netreach.net

On THIS site you will find everything you need to get up and running. A script repository with almost 400 FREE sample scripts, a downloads section with FREE COM objects for scripting, a library of reference materials and an online discussion lounge to provide community based technical support. Check it out.


  Hi all,
      I'd like to start creating user accounts using ADSI/WSH scripts and/or ADSI in VB. I can find most of the information I need to do this, however I cannot find how to set the the actual Drive Letter used for the Home Directory. I can set the path but not the Drive Letter. Anyone know how to do this?

      And/all help is appreciated.

--
Tim Munro, Network Specialist
Computing & Communications Services, Carleton University

           * System error, strike any user to continue... *



Sun, 08 Sep 2002 03:00:00 GMT  
 ADSI Question

set adsUsr = adsCont.Create("User", strUsrID)
adsUsr.HomeDirectory = strPath
adsUsr.Put "HomeDirDrive", strDrv
adsUsr.Setinfo


  Hi all,
      I'd like to start creating user accounts using ADSI/WSH scripts and/or ADSI in VB. I can find most of the information I need to do this, however I cannot find how to set the the actual Drive Letter used for the Home Directory. I can set the path but not the Drive Letter. Anyone know how to do this?

      And/all help is appreciated.

--
Tim Munro, Network Specialist
Computing & Communications Services, Carleton University

           * System error, strike any user to continue... *



Mon, 09 Sep 2002 03:00:00 GMT  
 ADSI Question

Actually the difference is really slight and either should work according to documentation.

First, the reason why one may fail and another may not depends on how you are using and calling these methods and in what order.

Second, as long as you are using an Automation Language you can set these things directly  (Userobj.Homedrive="P:"), if not using an automation language you have to use the Put method (as far as I can tell) followed by .SetInfo

Without posting the entire article, read the ADSI 2.5 SDK Help File. Search for the title "Accessing an Individual Property in the Property Cache". In there you can see how one can appear to fail while another does not. Here's the short snippet on referencing in different ways:
Individual properties in the property cache can be referenced in several ways. From Automation languages, you use the property name directly. This is the ADSI property name, for example, Name or Class, both properties defined on IADs. You can also use the property names as it is defined in the schema object. Then you can use the IADs::Get or any of its related interfaces, GetEx, Put, and PutEx. In each of these cases, you pass the name of the property as it is defined in the schema as the first parameter.

From non-Automation languages, you can also use the IADs::Get method and its related methods as described previously. In addition, you can use the get_propertyname and put_propertyname methods supported on all ADSI interfaces.

Shawn



    Take a look at the adsiFAQ on my site.... http://cwashington.netreach.net/script_repository/faqs.asp?topic=adsifaq

      This page gave me what I needed, thanks very much. However, seeing how it was implemented, brings up a syntax question.
      What is the difference between Userobj.put "Homedrive", "P:" and Userobj.Homedrive="P:"? Why do some properties require the PUT method to be used instead of a simple assingment?

--
Tim Munro, Network Specialist
Computing & Communications Services, Carleton University

           * System error, strike any user to continue... *



Wed, 11 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Stupid VBScript/ADSI question

2. ADSI Question

3. Another ADSI question...

4. Stupid VBScript/ADSI question

5. ADSI questions user properties

6. ADSI question

7. ADSI Question

8. ADSI Question

9. ADSI question

10. ADSI question (can I just installl it on our PDC?)

11. ADSI question (can I just installl it on our PDC?)

12. VBS and ADSI Object begginer question.

 

 
Powered by phpBB® Forum Software