Tags » Active Directory

AD: Defining primary group membership with Powershell

NOTE: Be sure to change the Temp user/group entries in $NewGroup and $BaseOU to your required distinguished names.

# The current Domain
$DomainNC = (“LDAP://RootDSE”).DefaultNamingContext… 151 more words

Microsoft

Last logon revisited

I’ve not blogged for a while now as I am right in the middle of a 2012 upgrade at work and rebuilding my house, oh joy! 899 more words

PowerShell

How to move a Secondary ADFS to Primary?

When you deploy AD FS 2.x out of the box and install in a default setup, it will make use of a Windows Internal Database (WID) 158 more words

Windows Server/Client

AD: Adding users to local security groups using Group Policy

In this example, we will add all domain users to the local computers’ Power Users group for all computers in the domain.

Microsoft

AD: Powershell script to disable and delete user accounts in a specific OU

#######################################################################################
##DisabledUserCleanup.ps1
##This script is designed to poll AD for any disabled user accounts that are over 30 days old and deletes them.
##The results are put into a file and then emailed to IT staff. 84 more words

Microsoft

AD: Powershell script to delete expired accounts

Import-Module ActiveDirectory
Search-ADAccount -AccountExpired -UsersOnly |
Where { $_.AccountExpirationDate -lt (Get-Date).AddDays(-30) } |
Remove-ADUser

Microsoft