Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

error when using adsi

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-20-2007   #1 (permalink)
laurent
Guest


 

error when using adsi

Hello,

i'm working on a VHD image (DC windows 2003 and exchange 2007) and i want
just to create an OU using powershell.
after looking on website i found the following code :
$domain = [ADSI]"LDAP://localhost:389/DC=contoso,DC=com"
$ou = $domain.create("OrganisationalUnit","ou=test")
$ou = $ou.setinfo()

but when i want to execute the script, i encountered this error :
Unable to find type [ADSI]: make sure that the assembly containing this type
is loaded.

Is it normal ?
Thanks
Laurent



My System SpecsSystem Spec
Old 03-20-2007   #2 (permalink)
/\/\o\/\/ [MVP]
Guest


 

RE: error when using adsi

are you on PowerShell RTM ?


"laurent" wrote:

> Hello,
>
> i'm working on a VHD image (DC windows 2003 and exchange 2007) and i want
> just to create an OU using powershell.
> after looking on website i found the following code :
> $domain = [ADSI]"LDAP://localhost:389/DC=contoso,DC=com"
> $ou = $domain.create("OrganisationalUnit","ou=test")
> $ou = $ou.setinfo()
>
> but when i want to execute the script, i encountered this error :
> Unable to find type [ADSI]: make sure that the assembly containing this type
> is loaded.
>
> Is it normal ?
> Thanks
> Laurent
>
>
>

My System SpecsSystem Spec
Old 03-20-2007   #3 (permalink)
laurent
Guest


 

Re: error when using adsi

thanks a lot, it was the problem...... it's an older version of powershell
who comes with the vhd
i launch my script after installing the RTM version and now all is fine.
Laurent


"/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> a écrit dans le message
de news: 5408E50C-3CDB-43D0-A41F-EC1EB7378724@microsoft.com...
> are you on PowerShell RTM ?
>
>
> "laurent" wrote:
>
>> Hello,
>>
>> i'm working on a VHD image (DC windows 2003 and exchange 2007) and i want
>> just to create an OU using powershell.
>> after looking on website i found the following code :
>> $domain = [ADSI]"LDAP://localhost:389/DC=contoso,DC=com"
>> $ou = $domain.create("OrganisationalUnit","ou=test")
>> $ou = $ou.setinfo()
>>
>> but when i want to execute the script, i encountered this error :
>> Unable to find type [ADSI]: make sure that the assembly containing this
>> type
>> is loaded.
>>
>> Is it normal ?
>> Thanks
>> Laurent
>>
>>
>>



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Frustrating ADSI Stephan Winkler PowerShell 9 02-12-2007 09:07 AM
ADSI Documentation? Jim Holbach PowerShell 3 10-15-2006 08:01 PM
Trapping and ADSI? Dan Metzler PowerShell 19 10-09-2006 01:12 PM
[ADSI] getting COM properties . /\\/\\o\\/\\/ [MVP] PowerShell 0 09-29-2006 11:36 AM
ADSI pwdLastSet (to UTC or not to UTC) =?Utf-8?B?L1wvXG9cL1wvIFtNVlBd?= PowerShell 0 07-17-2006 10:32 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51