Terminated Employee Cleanup

Terminated Employee Cleanup

posted Apr 24, 2019, 4:53 PM 

Context -
The purpose of this task was to automate the removal of saved terminated employee data after 90 days. This data was housed on a NAS device. Data was uploaded using a USMT script capturing user state and profile related information. An interesting element of the PowerShell script was the addition of a custom module used to overcome the infamous 260-character path length limit.
— Oz

1.   Navigate to \\<UNCPath>\tools$\Scripting\TEC.  Copy the directory structure to the target server under C:\Program Files\Scripts\TEC.  

TEC1.png

2.   From within C:\Program Files\Scripts\TEC, copy the NTFSSecurity directory to C:\Windows\System32\WindowsPowerShell\v1.0\Modules.

TEC2.png

3.  Create an AD account called tenas. Edit the TEC folder to give the tenas account modify privileges.

4.    Add the tenas account to the Power Users group of the  Server.

5.  Type secpol.msc from the run bar.  Navigate to the following:

TEC3.png

 6.       Add the tenas  account as shown below.

TEC4.png

   7.  Make sure the Powershell ISE is an added feature on the Server

TEC5.png

8. Type “power” in the search bar.

9.  Select PowerShell ISE and Run as Administrator.

TEC6.png

10.    From the console type get-executionpolicy.  Make sure its set to unrestricted.

TEC7.png

11.   If not then type the following:

TEC8.png

12.   From the console type get-host and verify the version of PowerShell is 3 or above. 

TEC9.png

  13.   If this is version navigate to \\UNCPath\tools$\Scripting\Powershell 3 and install from one of the following based on architecture.  

TEC10.png

  14.   From within the Powershell ISE, open the following file: C:\Program Files\Scripts\TEC\PS\TermEmpCleanupV2.ps1

15.   Scroll down to line 37 and change the path to reflect the site NAS server.

TEC11.png

       Do the same for line 54.

TEC12.png

16.   SAVE

17.   Open up Computer Mgmt. and select Task Scheduler.  Choose Import Task

TEC13.png

 18.   Navigate to C:\Program Files\Scripts\TEC\TS and select the following:

TEC14.png

 19.   Click OK and input the password.

TEC15.png

20.   This completes the TEC Deployment Process.

Previous
Previous

Windows 7 to Windows 10 Upgrade

Next
Next

Performance