Jump to content


  • Posts

  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    eDecisions got a reaction from Jamie Taylor in Make batch file run in foreground   
    Did this a long time ago... This one maps a drive letter to the server for the logged in user, you can work backwards to do anything, basically you have to create a task to make it happen that runs once on demand as the local user:
    $Taskname = "netuse"
    $lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser")
    SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $Taskname /RU $lastlogon /TR "c:\maplist.bat"
    start-sleep -s 1
    New-Item c:\maplist.bat -ItemType "file"
    Set-Content c:\maplist.bat 'net use t: "\\twdserver\Shared\SERVER - Documents" /persistent:yes'
    schtasks /Run /TN $Taskname
    start-sleep -s 1
    schtasks /delete /tn $Taskname /f
  2. Upvote
    eDecisions got a reaction from _mike in Uninstall NINJARMM Agent   
    Revised script, the (x86) was causing issues, this seems to have fixed
    $UninstallString = (Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NinjaRMMAgent*).UninstallString

    $path = $UninstallString -replace "uninstall.exe", ""
    cd $path
    Start-Process -FilePath .\uninstall.exe -ArgumentList "--mode","unattended"
  3. Thanks
    eDecisions got a reaction from Continu IT Solutions in Add domain\username to header search on username   
    Be nice if you reference the Author rather than "I found this" I wrote it, thanks for the plug.
  • Create New...