This script deletes users from the NoSpamProxy NoSpamProxyAddressSynchronization database table [Usermanagement].[User] table that have not been removed by the NoSpamProxy Active Directory synchronization job.
The script was developed due to a process flaw in how Active Directory accounts are handled as part of a leaver process. So this script does not fix a software bug but a process glitch.
Due to the Active Directory account process, the accounts still exist in Active Directory and are synchronized to the NoSpamProxyAddressSynchronization database.
When executed without the -Delete parameter, all identified users are written the log file only.
- Windows Server 2012 R2 or Windows Server 2016
- Uses GlobalFunction library found here http://scripts.granikos.eu or https://www.powershellgallery.com/packages/GlobalFunctions
- NoSpamProxy PowerShell module, script requires to run on a server having NoSpamProxy installed
- ActiveDirectory PowerShell Module (Install-WindowsFeature RSAT-AD-PowerShell)
# EXAMPLE 1 # Check for Active Directory existance of all users stored in NoSpamProxy database. # Do NOT delete any users from the database. .\Remove-NspUsers.ps1 # EXAMPLE 2 # Delete users from NoSpamProxy database hosted on SQL instance MYNSPSERVER\SQLEXPRESS # that do NOT exist in Active Directory. .\Remove-NspUsers.ps1 -Delete -SqlServerInstance MYNSPSERVER\SQLEXPRESS
- 1.0, Initial community release
- Download and follow at Github: https://github.com/Apoc70/Remove-NspUsers
- Twitter @stensitzki