User name anonymization with powershell

Forums Desktop Info User name anonymization with powershell

  • This topic has 1 reply, 2 voices, and was last updated 6 days ago by Glenn.
Viewing 1 reply thread
  • Author
    Posts
    • #4111
      KaMeLi
      Participant

      Hi -In my environment, we have a username in the first name and surname format (eg Jones.Indiana).
      I would like to anonymize the full name, e.g .:
      Ion**
      Indium****
      I made a powershell oneliner but I don’t know how to apply it (the script works fine outside of DesktopInfo).
      I am asking for help in starting (below example for the first segment):
      powershell.exe -Command “$UserName = $env:UserName; $UserFirst = (Get-Culture).TextInfo.ToTitleCase($UserName.split(‘.’)[0]); $UserFirstHide = $UserFirst.SubString(0,3); $StringFirst = $UserFirst.Length -3; $HideFirst = $UserFirstHide+(‘*’ * $StringFirst) | Write-Host -NoNewline”

    • #4112
      Glenn
      Keymaster

      it works if you put it in a script file, say anonymize.ps1, then call the script from DTI:

      CMD=text:User,code-page:65001,file:powershell.exe,parameters:sample-scripts\anonymize.ps1,display:%4

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Glenn's Page