One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| $SplitHereString = @" | |
| a | |
| b | |
| c | |
| "@ -split [System.Environment]::NewLine | |
| $SplitHereString.GetType() # notice it's String[] / System.Array | |
| $ConstructedArray = @('a','b','c') |
| # define your query filter | |
| $LDAPfilter = "(samaccountname=*)" | |
| # define the object attributes you want returned | |
| $Attributes = @" | |
| samaccountname | |
| givenname | |
| surname | |
| #Get Exchange Servers | |
| Get-ADObject -SearchBase $(Get-ADRootDSE).configurationNamingContext -Filter {objectCategory -eq "msExchExchangeServer"} | |
| # Find well-known Exchange groups in Active Directory | |
| Get-ADObject $(Get-ADRootDSE).configurationNamingContext -Filter {objectclass -eq "msExchConfigurationContainer"} -Properties otherwellKnownObjects | select -ExpandProperty otherwellKnownObjects | %{$_.Split(":")[-1]} |
| $AuthenticationType = [System.DirectoryServices.AuthenticationTypes]::Secure | |
| $DirectoryConnection = New-Object -TypeName System.DirectoryServices.Protocols.LdapConnection -ArgumentList "ldapserver.domain.com:777,uid=newuser,ou=people,dc=company,dc=com", $password , $AuthenticationType | |
| $DirectoryConnection.Bind() | |
| $DirectoryRequest = New-Object -TypeName System.DirectoryServices.Protocols.AddRequest | |
| $DirectoryRequest.DistinguishedName = "uid= xxxx, ou=user, o=company" | |
| $DirectoryRequest.Attributes.Add((New-Object -TypeName System.DirectoryServices.Protocols.DirectoryAttribute -ArgumentList "objectclass",@("top","organizationalPerson","person","inetorgperson","inetuser","mailrecipient","pwmuser","posixAccount"))) | Out-Null | |
| $DirectoryRequest.Attributes.Add((New-Object -TypeName System.DirectoryServices.Protocols.DirectoryAttribute -ArgumentList "cn",($FirstName+" "+$LastName))) | Out-Null | |
| $DirectoryConnection.SendRequest($DirectoryRequest) |
| [ADSI]"LDAP://RootDSE" | fl * | |
| ([ADSI]"LDAP://RootDSE").configurationNamingContext | |
| ([ADSI]"LDAP://RootDSE").get("configurationNamingContext") | |
| # Domain Distinguished Name | |
| ([ADSI]"LDAP://RootDSE").defaultNamingContext |
| # powershell find duplicate files md5 | |
| # powershell get childitem filter duplicates | |
| # script to find duplicate files windows | |
| # powershell duplicate files md5 | |
| gci * -Recurse | get-filehash -Algorithm MD5 | Group-Object hash | ?{$_.count -gt 1} | select @{n='DupeCount';e={$_.Count}}, @{n='DupeFiles';e={$_.Group.Path -join [System.Environment]::NewLine}} | Out-GridView | |
| #get dnsroot | |
| [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().Name | |
| #get domain distinguishedname | |
| [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().GetDirectoryEntry().Properties["distinguishedName"] | |
| #list domain controllers | |
| [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().FindAllDomainControllers().Name | |
| #get PDC |
| # check dot net version | |
| gci 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | gp -name Version,Release -EA 0 | ?{ $_.PSChildName -match '^(?!S)\p{L}'} | select PSChildName, Version, Release | |
| # how to check net framework version installed | |
| # where can i find net framework on my computer | |
| # verify net framework version installed | |
| # determine .net framework versions | |
| # where to find net framework on computer |
| <# | |
| Set Active Directory Users Terminal Services Profile Path Using PowerShell | |
| There is no remote desktop services profile path attribute, because TerminalServicesProfilePath is saved in the Active Directory user object's UserParameters attribute as a binary blob | |
| This snippet will find ADUsers that match $TSProfilePath_OLD and set their remote desktop services profile path to $TSProfilePath_NEW | |
| #> | |
| # Need Active Directory Cmdlets | |
| Import-Module ActiveDirectory | |
| # Change TerminalServicesProfilePath only on users that are currently pointing to: |