Jump to content

eDecisions

Members
  • Content Count

    42
  • Joined

  • Last visited

About eDecisions

  • Rank
    IT Sidekick
  • Birthday 05/01/1962

Profile Information

  • Gender
    Male
  • Location
    Sacramento Ca
  • Interests
    67 Camaro :)

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. way too much work, this adds a script by currently logged in use or last logged in user if system is logged off, note this is a powershell script, also I set its start time for before current time so it will only run if you manually start it but do what you will. #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
  2. create a task, far easier, I use powershell, just add the command after the TR = Task Run #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. if you like to run a command as the user a quick way is to create and run a scheduled task setup as the logged in user and run it, see power shell example to start and restart explorer. #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
  4. your missing the point of pulseway, why would you want to ever run a batch file located on your desktop, copy the batch file to pulseway and run it from there.
  5. I too played with them, I found as currently configured they are of no use to me, what I'm waiting for is a prompt at run time, you click your script and you get a prompt: enter drive lettr: or enter user name: or enter something, I'd find that a lot more usefull.Insert other media
  6. Script enables RDP if its disabled, and enables if its disabled. #By eDecisions $RDP = (Get-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server').fDenyTSConnections If ($RDP -eq 0) { Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value "1" } IF ($RDP -eq 1) { Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value "0" }
  7. 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
  8. Be nice if you reference the Author rather than "I found this" I wrote it, thanks for the plug.
  9. This script changes the state of Hidden files, if hidden files are set to show this turns them off, if hidden files are set to hide this shows them. Comments? # This key contains all of the profiles on the machine (including non-user profiles) $profileList = Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" # This key contains the path to the folder that contains all the profiles (typically c:\users) $profileFolder = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList').ProfilesDirectory # This key contains the path to the default user profile (e.g. C:\Users\Default). This is **NOT** HKEY_USERS\.DEFAULT! # We don't do anything with it in this sample script, but it can be loaded and modified just like any other profile. $defaultFolder = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList').Default # HKEY_USER key is not loaded into PowerShell by default and we'll need it, so we'll create new PSDrive to reference it. New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null $profileList | % { $profileKeys = Get-ItemProperty $_.PSPath $sid = $profileKeys.PSChildName $profilePath = $profileKeys.ProfileImagePath # This is an easy way to exclude profiles outside of the default USERS profile folder, e.g. LocalSystem. # You may or may not want to do this depending on your requirements. if ($profilePath -like "$($profileFolder)*") { # Check if the profile is already loaded. if (Get-ChildItem "HKU:\$sid" -ErrorAction SilentlyContinue) { $profileLoaded = $true } else { $profileLoaded = $false } Write-Output "$sid `t $profilePath `t $profileLoaded" # Load the key if necessary if ($profileLoaded) { $userKeyPath = "HKU:\$sid" } else { $userKeyPath = "HKLM:\TempHive_$sid" & reg.exe load "HKLM\TempHive_$sid" "$profilePath\ntuser.dat" } # DO SOMETHING WITH $USERKEYPATH HERE. ############################################################################################# $hide = (Get-ItemProperty -path $USERKEYPATH\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced).Hidden If ($hide -eq 0) { Set-ItemProperty -Path $USERKEYPATH\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name Hidden -Value "1" } IF ($hide -eq 1) { Set-ItemProperty -Path $USERKEYPATH\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name Hidden -Value "0" } ############################################################################################## if (!$profileLoaded) { & reg.exe unload "HKLM\TempHive_$sid" } } } Remove-PSDrive -Name HKU ################################################################ $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
  10. Install Chocolatey choco install microsoft-teams.install -fvy
  11. Personally I'd change it to a dos batch file rather than powershell, user accont settings are easlry set there.
  12. Hay BartB, I agree, I followed your advise and it works well, I'm worried however about the source files, It would be very cool if a group of us Pulseway users worked to as a team to setup our own file hosting of secure files, interested in starting something up?
  13. How about adding some logic, if exist use vpnname-1 , vpnname-2 vpnname--3 ect..... who knows the user maybe tried setting up or heck even the other admin and messed it up and you want to have a working vpn connection. Just a thought.
  14. Darn, the MSI and agent both need to be removed, I wrote this to finish it up, but if anyone has a better way or can assist with a loop to pull both keys in one pass, I'm just tired. and this worked and all are removed from 500 stations with this one so I don't need it any more. I'd sense used the Get-ChildItem to uninstall several other programs, but I know it will pull more than one path so I'd love to re-write this to loop thru all the possible msi and exe and hit them both in a few lines rather than this, but it works as is, any input from someone more knowledgeableble than me please, I'm not proud. $UninstallString = (Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NinjaRMMAgent*).UninstallString sleep -seconds 2 if (!$UninstallString) { exit } sleep -seconds 2 $path = $UninstallString -replace "uninstall.exe", "" sleep -seconds 5 cd $path sleep -seconds 5 Start-Process -FilePath .\uninstall.exe -ArgumentList "--mode","unattended" sleep -seconds 40 $Uninstall2 = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -match "NinjaRMMAgent" } | Select-Object -Property UninstallString | foreach { $_.UninstallString } sleep -seconds 220 $Uninstall3 = $Uninstall2 -Replace "MsiExec.exe " , "" sleep -seconds 5 Start-Process -FilePath MSIExec.exe -ArgumentList $Uninstall3,"/quiet","/passive"
  15. 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"
×
×
  • Create New...