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.
<# | |
one-liner to quickly determine IIS version information from a Powershell prompt | |
#> | |
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\InetStp' | select InstallPath, VersionString, @{n="ProductVersion";e={(Get-ItemProperty ($_.InstallPath + "\w3wp.exe")).VersionInfo.ProductVersion}} |
<# | |
@scriptingpro | |
Using powershell to promote a new domain controller | |
This will Install a new RODC | |
Todo: | |
parameterize SafeModeAdministratorPassword (DSRM password) | |
#> | |
#First add the Active Directory Domain Services feature to your server |
<# | |
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: |
# 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 |
#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 |
# 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 | |
[ADSI]"LDAP://RootDSE" | fl * | |
([ADSI]"LDAP://RootDSE").configurationNamingContext | |
([ADSI]"LDAP://RootDSE").get("configurationNamingContext") | |
# Domain Distinguished Name | |
([ADSI]"LDAP://RootDSE").defaultNamingContext |
$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) |
#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]} |