/\/\o\/\/ PowerShelled

This blog has moved to http://ThePowerShellGuy.com Greetings /\/\o\/\/
$AtomFeed = ("Atom.xml")
$PreviousItems = (" First Monad B3 impression and please help the scri... "," Monad Beta 3 is released ! "," Report MP3 count and size by User from MSH "," YMCK "," Hosting Iron Python in MSH. "," MSH How can I Determine Which Text has been Select... "," Monad(MSH) Beta 3 is getting closer "," Monad Beta 3 is Coming soon and I got a MVP award "," Adding a Simple AccesRule to a file ACL in MSH "," Colorized MSH LS replacement. "," ")

Wednesday, January 11, 2006

 


Filling Emty Properties in AD from MSH



As I was testing again on my ADSI LargeInterger problem, see Monad(MSH) Beta 3 is getting closer

B3 did not solve this, I did Impoort the ADSI typelibrary but I did not mentioned to do it yet.

But as I used Adam for testing (see Monad and Adam (and a preview of my to-be AD provider)

My user object kind was of empty.

I was missing a lot of properties, for example the first and lastname.
becouse you will not get them back if they are not set.

you can see in the samples below how to get those properties filled,
first I used ADSIEdit to fill Firstname (Givenname) and lastname (sn),

You can see that after a RefreshCache() in MSH, I can see the New Properties,

you can also "create" the property by filling it with invokeset()

$mow = new-object system.directoryservices.directoryentry("LDAP://localhost:389/cn=mow,ou=mowOu,dc=mow,dc=adam")

MSH>$mow.get_Properties().propertynames
objectClass
cn
distinguishedName
instanceType
whenCreated
whenChanged
displayName
uSNCreated
uSNChanged
name
objectGUID
badPwdCount
badPasswordTime
pwdLastSet
objectSid
objectCategory
nTSecurityDescriptor

# did fill the First and Last Name with ADSIEdit

MSH>$mow.sn
MSH>$mow.invokeget('sn')
MSH>$mow.RefreshCache()
MSH>$mow.sn
SurName


# Making the new Property

$mow.invokeset('street',"MowDrive")
$mow.CommitChanges()

MSH>$mow.get_Properties()

PropertyName                       Value
------------                       -----
sn                                 SurName
givenName                          Mow
objectClass                        {top, person, organizationalPer...
cn                                 mow
street                             MowDrive
distinguishedName                  CN=mow,OU=MowOu,DC=mow,DC=adam
instanceType                       4
whenCreated                        11/21/2005 12:11:42 AM
whenChanged                        1/11/2006 8:43:21 PM
displayName                        mow
uSNCreated                         System.__ComObject
uSNChanged                         System.__ComObject
name                               mow
objectGUID                         {161281039722423859...
badPwdCount                        0
badPasswordTime                    System.__ComObject
pwdLastSet                         System.__ComObject
objectSid                          {15002224157174, ...
objectCategory                     CN=Person,CN=Schema,CN=Configur...
nTSecurityDescriptor               System.__ComObject


for now I used ADSIEdit to look up the property values, but ofcourse we get get them from Monad too , by looking at the schema, more about that later.

gr /\/\o\/\/

Tags :


Comments: Post a Comment



<< Home

Archives

October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006  

$Links = ("PowerShell RC1 Docs"," PowerShell RC1 X86"," PowerShell RC1 X64"," Monad GettingStarted guide"," Monad Progamming Guide"," Monad SDK"," Monad videos on Channel 9"," MSH Community Workspace"," scripts.readify.net "," MonadSource"," www.reskit.net"," PowerShell Blog"," Under The Stairs"," computerperformance powershell Home"," proudlyserving"," MSH on wikipedia"," MSHWiki Channel 9"," Keith Hill's Blog"," Precision Computing"," PowerShell for fun"," MSH Memo (Japanese)"," monadblog")

find-blog -about "PowerShell","Monad" | out-Technorati.
find-blog -contains "","" | out-Technorati.
Google
 
Web mow001.blogspot.com

This page is powered by Blogger. Isn't yours?