26 July 2012

Powershell 3.0 Release Candidate

Powershell 3.0 release candidate (Windows Management Framework 3.0) is now available for download;
http://www.microsoft.com/en-us/download/details.aspx?id=29939


It can be installed on:

  • Windows 7 Service Pack 1
  • Windows Server 2008 R2 SP1
  • Windows Server 2008 Service Pack 2
You also need to install Microsoft .NET Framework 4.0;


24 July 2012

Active Directory Ldap attributes and classes

If you need detalied information about active directory ldap attributes like size of the field or the data type accepted you can use the msdn documentation:


Active Directory classes: http://msdn.microsoft.com/en-us/library/ms680938(v=vs.85)

12 July 2012

Rename-ADObject

If you try to change the "name" ldap attribute of an Active Directory object using the Set-ADUser / Set-ADComputer or any other comdlet that can modify object properties you will get an error message like this:


Set-ADUser : The attribute cannot be modified because it is owned by the system


In order to chnage the "name" ldap attribute use the Rename-ADObject cmdlet.

Example: Rename-ADObject -Identity $user -NewName $newName

09 July 2012

Title case using ToTitleCase method

to transform the first letter of a word (or the first letter of every word of a phrase) to title case you can use ToTitleCase method of Get-Culture command:

(Get-Culture).TextInfo |Get-Member


ToTitleCase    Method     string ToTitleCase(string str)

06 July 2012

Test AD Group Membership

$Group = [ADSI]"LDAP://CN=Group Name,OU=Groups,DC=office,DC=net"
$User= [ADSI]"LDAP://CN=User Name,OU=Users,DC=office,DC=net"

If ($Group.IsMember($user.ADsPath) -eq $True){
    "User is member of group"
    }
else{
    "User is not member of group"
    }


More information about ADSI:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa772212(v=vs.85).aspx

More information about IADsGroup interface and IsMember method:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa706021(v=vs.85).aspx