Useful Script for exporting Users from AD/Exchange

Reading Time: < 1 minute

Script to export list of users with forwarders configured

Get-mailbox | select DisplayName,ForwardingAddress | where {$_.ForwardingAddress -ne $Null} | select DisplayName,ForwardingAddress | where {$_.ForwardingAddress -ne $Null} | out-string -Width 999 > c:\ListOfForwarders.txt

List mailboxes where Automatically update email addresses is set to disabled

Get-Mailbox -ResultSize Unlimited | Where {$_.EmailAddressPolicyEnabled -eq $False} > c:\AddressUpdateDisabled.txt

Mailboxes with Send As Permission

get-mailbox | Get-ADPermission | ? { ($_.ExtendedRights -like “send“) -and -not ($_.User -like “\self“) } | FT -auto identity, User,ExtendedRights | out-string -Width 999 > c:\sendAsConfigured.txt

Export users where the primary SMTP does not match the UPN

Get-ADUser -Filter {Mail -like “*”} -Properties Mail,UserPrincipalName,CN |? {$_.UserPrincipalName -ne $_.Mail} | Select Mail,UserPrincipalName,CN | out-string -Width 999 > c:\UPNDoesNotMatch.txt

Export all user accounts

get-user -resultsize unlimited | FT DisPlayName, SamaccountName, SID, UserPrincipalName, WindowsEmailAddress | out-string -Width 150 > c:\AllUsers.txt

List In-Policy bookings settings on resource mailboxes

Get-MailBox | where {$_.ResourceType -eq “equipment”} | Get-CalendarProcessing | Format-List > c:\resourceMbx.txt

Export domain accounts and Mailbox statistics

get-Mailbox -resultsize unlimited | Get-MailboxStatistics | FT DisplayName, MailboxGuid, ItemCount, TotalIDeletedtemSize, TotalItemSize | out-string -Width 999 > c:\MailboxStats.txt

Authentication Error Has Occurred. The function requested is not supported

Reading Time: < 1 minute

When attempting to RDP to a server, you may receive the below error:

Authentication Error Has Occurred. The function requested is not supported

There are a couple of ways you can resolve this issue:

Option 1:
1) Click start, click run, type gpedit.msc and click ok
2) Browse to Computer Configuration > Administrative Templates > System > Credentials Delegation > Encryption Oracle Remediation
3) Within Encryption Oracle Remediation click enable and change protection level to Vulnerable and click apply

Option 2:
1) Click start
2) Locate My Computer or This PC depending on your OS version
3) Right click and click properties
4) Click advanced system settings
5) Click the Remote tab
6) Untick the box ‘Allow connections only from computers running remote desktop with network level authentication’
7) Click ok

How to check if LSA Protection was successfully enabled

Reading Time: < 1 minute

  1. Access Event logs
  2. Access System Logs under Windows
  3. Locate event ID 12, should be labelled as Wininit and display the below message

    LSASS.exe was started as a protected process with Level 4

    A reboot is required after you have enabled LSA Protection

    Please read the below link before applying LSA Protection:

    https://docs.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/configuring-additional-lsa-protection

The target server is already a domain controller

Reading Time: < 1 minuteYou have promoted your server to a DC, but find that when you go into server manager the alert prompting to promote the server to a DC is still there.

This seems to be a bug and there is an easy way to get around this:

  1. Click Server Manager
  2. Click the link to promote server to DC
  3. Wait for the process to timeout, until you receive the error below. Click show more so the error pops up in a small window.

    Error determining whether the target server is already a domain controller. The target server is already a domain controller

  4. Click the OK button
  5. Click cancel button, so no windows are now showing
  6. Close server manager
  7. Open server manager and the alert should have disappeared

svchost The version store for this instance (0) has reached its maximum size of 2Mb

Reading Time: < 1 minuteError:
Event ID: 623 Source: esent
svchost ( ) The version store for this instance ( ) has reached its maximum size of 2Mb. It is likely that a long-running transaction is preventing cleanup of the version store and causing it to build up in size. Updates will be rejected until the long-running transaction has been completely committed or rolled back.

Possible resolution:
If all your servers are getting stuck on the welcome screen for up to 5 minutes when logging on, identify which Domain Controller they are authenticating against, disable the Smart Card Device Enumeration Service on the Domain Controller and reboot. For more details please visit https://cloudbuild.co.uk/?p=2468