#######################################
# Skrypt PowerShella
# (C) dr Holger Schwichtenberg
# http://www.powershell-doktor.de
########################################
#new-object system.directoryservices.directoryEntry("LDAP://e02/CN=dr Holger Schwichtenberg,OU=Gf,DC=IT-Visions,DC=local", "hp", "hp+123") | get-member *guid*
#new-object system.directoryservices.directoryEntry("LDAP://e02/CN=dr Holger Schwichtenberg,OU=Gf,DC=IT-Visions,DC=local") | get-member
#new-object system.directoryservices.directoryEntry("LDAP://e02/CN=dr Holger Schwichtenberg,OU=Gf,DC=IT-Visions,DC=local") 
[ADSI] "LDAP://XFilesServer"


#$taknie = [system.directoryservices.directoryEntry]::Exists("LDAP://xfilesserver/CN=Fox Mulder,OU=Agents,DC=FBI,DC=net")
$taknie = [ADSI]::Exists("LDAP://xfilesserver/CN=Fox Mulder,OU=Agents,DC=FBI,DC=net")

$o = new-object system.directoryservices.directoryEntry("LDAP://xfilesserver/CN=Fox Mulder,OU=Agents,DC=FBI,DC=net", "FoxMulder", "I+love+Scully")

"Nazwisko: "+ $o.sn
"Miasto: " + $o.l
"Telefon: " +$o.Telephonenumber
"Inne numery: " +$o.OtherTelephone
"Klasa: " + $o.PSBase.SchemaClassName
"GUID: " + $o.PSBase.Guid

$o.PSBase.UsePropertyCache = 0

$o.Telephonenumber = "+49 201 7490700"
$o.OtherTelephone = "+49 201 7490700","+49 201 7490700","+49 201 7490700"
$o.SetInfo()

# lub:
#$o.PSBase.CommitChanges()

#$o.get_NativeObject().adspath

