
PowerShell – List AD Users Password Expiry Dates
The PowerShell script below will list you Display Name and Password Expiry Date of all AD users.
1 |
Get-ADUser -filter {(Enabled -eq $True) -and (PasswordNeverExpires -eq $False)} -Properties DisplayName, msDS-UserPasswordExpiryTimeComputed | Where-Object {$_.DisplayName -ne $null} | Select DisplayName,@{Name="ExpiryDate";Expression={([datetime]::fromfiletime($_."msDS-UserPasswordExpiryTimeComputed"))}} |
It uses the msDS-UserPasswordExpiryTimeComputed attribute, be aware of that attribute is not exists on AD LDS. It is implemented on Windows Server 2008 operating system, Windows Server 2008 R2 operating system, Windows Server 2012 operating system, and Windows Server 2012 R2 […]

Powerhell ile AD sorgulamaları için basit bir script
Bu basit ve küçük PowerShell scriptini el altında bulundurarak Active Directory (AD) nizi hızlıca anahtar kelime kullanarak sorgulayabilirsiniz. Cevap olarak size obje tipi kısıtlaması olmadan bulduklarını döndürecektir. Bu basit halini isterseniz değiştirip daha farklı işler de yaptırabilirsiniz. Derinlemesine aramalardan önce kolayca obje bulma konusunda yardımcı olacağını düşünüyorum.
1 2 3 4 5 6 |
param( [Parameter(Mandatory=$true,Position=1)][string]$Query ) $filter = "anr=$Query" $dc = "DCSunucunuz:3268" Get-ADObject -LDAPFilter $filter -Server $dc |
Kullanımı .\Get-Something01.ps1 osxx Çıktısı DistinguishedName Name […]

Handy Powershell script to query AD for any object
I believe keeping this handy and simple PowerShell script within reach is a good idea to query your Active Directory (AD) quickly with a hint of name. It will return you objects that have your wildcard in it. Quick way find things before digging more.
1 2 3 4 5 6 |
param( [Parameter(Mandatory=$true,Position=1)][string]$Query ) $filter = "anr=$Query" $dc = "YourDC:3268" Get-ADObject -LDAPFilter $filter -Server $dc |
Usage .\Get-Something01.ps1 osxx Output DistinguishedName Name ObjectClass ObjectGUID CN=Osman SHENER,… Osman […]
How to install AD DS and create forest via PS?
Here is another small tip to create a new forest on a clean Windows Server 2012 R2, it installs AD DS, DNS and necessary administrative tools, and creates your forest, DNS entries etc.
1 2 3 4 5 6 |
Import-Module ServerManager Install-WindowsFeature AD-Domain-Services Import-Module ADDSDeployment Install-ADDSForest -DomainName lab.infralib.com -DomainNetbiosName lab -SafeModeAdministratorPassword (ConvertTo-SecureString -String "YourPasswordHere" -AsPlainText -Force) -NoDnsOnNetwork -InstallDns -DomainMode Win2008R2 -ForestMode Win2008R2 -NoRebootOnCompletion -Confirm:$false Add-WindowsFeature RSAT-AD-Tools Restart-Computer |
Very useful information about AD DS Deployment Cmdlets can be found at http://technet.microsoft.com/en-us/library/hh974720.aspx / http://technet.microsoft.com/en-us/library/hh472162.aspx
WDS Auto-Add ve AD’de Prestaging verilerini temizlemek
WDS Auto-Add veritabanini temizlemek WDS Auto-Add veritabanindaki onaylanmis bilgisayarlari her 30 gunde bir temizler. Isterseniz bu sureyi WDSUTIL /Set-Server /AutoAddPolicy /RetentionPeriod /Approved:Days komutu ile degistirebilirsiniz. (http://technet.microsoft.com/en-us/library/cc754289(WS.10).aspx) Ornegin 7 gune ayarlamak icin : WDSUTIL /Set-Server /AutoAddPolicy /RetentionPeriod /Approved:7 Eger isterseniz wdsutil /delete-AutoAddDevices /DeviceType:ApprovedDevices komutu ule tum onaylanmis bilgisayarlari Auto-Add veritabanindan temizleyebilirsiniz. (http://technet.microsoft.com/en-us/library/cc770832(WS.10).aspx). Ancak WDS Auto-Add veritabaninda […]