Jump to content

eDecisions

Members
  • Posts

    56
  • Joined

  • Last visited

Reputation Activity

  1. Like
    eDecisions got a reaction from Nick530 in Run automation scripts for group?   
    Second, seems backwards, I can run a script for 100 groups, I can run a script on a single client , but no I can’t run a script on an office.
     
    if I have 100 groups I’d need 100 scripts one for each group.
     
    i second adding the scripts as an option under group
  2. Thanks
    eDecisions got a reaction from skrie in Restart EXPLORER.EXE current logged in user   
    This will stop and restart EXPLORER.EXE for the currently logged in user.
     
     
    #By eDecisions
    $TasknameStop = "ExplorerStop"
    $TasknameStart = "ExplorerStart"
    $lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser")
    SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $TasknameStop /RU $lastlogon /TR "taskkill /f /im explorer.exe"
    SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $TasknameStart /RU $lastlogon /TR "explorer.exe" 
    start-sleep -s 1
    schtasks /Run /TN $TasknameStop
    start-sleep -s 1
    schtasks /Run /TN $TasknameStart
    start-sleep -s 1
    schtasks /delete /tn $TasknameStop /f
    schtasks /delete /tn $TasknameStart /f
  3. 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
     
  4. 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"
     
  5. 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...