Tags » Active Directory

Get all users and their memberships

I was asked to generate a report with all users and their memberships.

Found below script that helped me:

$memberOf = @{n='MemberOf';e={ ($_.MemberOf -replace '^CN=([^,]+).+$','$1') -join ';' }}

Get-QADUser -SizeLimit 0 | `
Select-Object Name,DN,SamAccountName,$memberOf | `
Export-Csv "C:\Reports\Users\report.csv" 21 more words
Active Directory

Active Directory Script Highlight: Identify User Not Logged in in 180 days

Domain migrations are in full swing so I thought I would start to share some of the scripts used in the process.  This one identifies users that have not logged on in over 180 days.  110 more words


FIX: Set default UserPrincipalName for bulk users

This is a pre-requisite for AD synchronization before migrating mailboxes to O365.

Run below script in an elevated PowerShell window on a domain controller:

$LocalUsers = Get-ADUser -SearchBase "OU=UserOU,DC=SUB,DC=ROOT,DC=NET" -Filter {UserPrincipalName -like 'old domain name'} -Properties userPrincipalName -ResultSetSize $null
$LocalUsers | foreach {$newUpn = $_.UserPrincipalName.Replace("old domain","new domian"); $_ | Set-ADUser -UserPrincipalName $newUpn} 45 more words

Azure AD Connect - Configure the "Enable-ADSyncExportDeletionThreshold" wisely

Today would shed some light on the cmdlet “Enable-ADSyncExportDeletionThreshold” which comes with the Azure AD Connect. If you are using Azure AD Connect to synchronize your On-Premise Active Directory to Azure Active Directory, Azure AD Connect will never execute a batch of more than 500 objects to delete. 100 more words

Azure AD

Firewall Ports - Microsoft Products

NP – this is a work in progress and firewall rules will be added over time.

Below details the firewall rules required for the below products: 323 more words

SQL Server

Active Directory Partition

Partitions in Active Directory:

 Each domain controller has a copy of active directory database, which is stored in a file called NTDS.DIT. The data in the file NTDS.DIT is divided into logical partitions. 220 more words