Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Be nice if you reference the Author rather than "I found this" I wrote it, thanks for the plug.
  3. Yesterday
  4. 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
  5. Is there something I can add to the script to also automatically sign in an account?
  6. I use Pulseway to monitor my finicky Dell Inspiron 15 7000 Gaming Laptop and I noticed my laptop has thousands upon thousands of logs in Event Logs. I specifically need the 'Application Event Logs', 'Security' and 'System' event logs saved, ideally as a .CSV file. I don't know much PowerShell/Bash/VBScript, so I was hoping someone knows how to do this.
  7. Last week
  8. Hello Arnd, I've responded to your email. Basically, the easiest way would be for you to have Pulseway take over the already installed Kaspersky Endpoint Security product and from there you'll be able to uninstall the product normally. -Paul
  9. Hi Paul (or other pulseway specialist) I've been using pulseway for quite a few years now and confronted with another i.t. company from new client that does not (want to...) remove pulseway and especially kaspersky, which is a pain in the a.. because without password i need to play nasty tricks, including restart both the domain server as wel as the terminal server. Do you folks have a script available to first remove kaspersky at least? I have already succesfully removed pulseway at another client, to replace it with my pulseway account. A script for both issues would be really neat but kaspersky is my greatest challenge at this moment. Looking forward to your support and reply Arnd
  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. I am having this exact same issue and cannot find out how to fix. I have tried to contact support but I either couldn't find it or I haven't gotten a response yet. I really look forward to finding a solution for this and anyone generous enough to share I would greatly appreciate it. Thank you.
  13. If we install the agent manually (or via GPO) and go and do a discovery and deploy later, The probe will show ALL systems on the network as Discovered, including those that have the agent on them already and will allow me to push the agent again. If we deploy to those systems we get duplicate machines showing up and have to go clear them out. Is this by design? It would be good if the probe could detect if the machine has the agent on it already and not show it or at lest show it has the agent on it already.
  14. Does anyone know if this will work: Set-LocalUser -Name username -ExpirePassword I extracted it from this link
  15. We use Puleway Webapp (RMM) and PSA. I have to setup to different logins (PSA is on SAML) for access. Is there any plans to allow us to link and integrate these two logins?
  16. I have a Windows 10 Pro (local) machine that is not responding to: wmic UserAccount set PasswordExpires=True I've been digging a big hole looking for a comparable powershell command. Anyone know? Also, how to check if the user cannot change password is set. It does not list using net accounts
  17. I found a powershell script that will update the computer name to do just this elsewhere on this forums (and for the life of me I cannot find it now to give the author credit). that creates the info just like my mockup. I modified it slightly from the original but here is the code I use: $lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser") $hostname = hostname $installtype = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallationType") $pos = $lastlogon.IndexOf("\") $leftPart = $lastlogon.Substring(0, $pos) $lastlogonusername = $lastlogon.Substring($pos+1) if ($installtype -eq "Server") { Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value $hostname , "/" , $leftPart }else { Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value $hostname , " - " , $leftPart , "\" , $lastlogonusername } Saved this as a script named Update Computername with User Then i set the computers to notify when user logs in as a low level notification then i created a workflow that triggers off that low level alert, runs this script, then deletes the notification and marks the workflow as a success Now i can search on username and it works!
  18. I've banged my head against this and found something workable. Just dumps the pictures from the server into every user folder under C:\users. Bypasses the need to pass %username% or %appdata% properly. cd C:\users for /f %%i in ('dir /b') do mkdir c:\users\%%i\appdata\roaming\Microsoft\Teams\Backgrounds\Uploads for /f %%i in ('dir /b') do copy "\\SHARED SERVER LOCATION\*.jpg" C:\users\%%i\appdata\roaming\Microsoft\Teams\Backgrounds\Uploads /y Hope this helps someone eventually! Cheers, Joe
  19. Earlier
  20. 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?
  21. 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.
  22. 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"
  23. This is by design. In order for a VPN connection to be used by all users, it must be at a level where all users can access it. So the VPN runs as system. This is why you can't see it's connection listed in Windows as the user. To run Powershell as system, you can modify the command line or check it out here. Start-Process -FilePath cmd.exe -Verb Runas -ArgumentList '/k C:\SysinternalsSuite\PsExec.exe -i -s powershell.exe'
  24. Hi Patrick, Our patch management feature will only restart the OS if the windows update component says a reboot is pending. I can help you fix the script if you share it here too. -Paul
  25. 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"
  26. Also found out about pulseway via LTT and it definitely needs a package for Synology!
  27. I don't think its possible to have more than one NINJARMM Agent installed, however if there are this script will likely fail, but for a clean ninja install will locate the correct uninstall path and uninstall the ninja agent. $UninstallString = (Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NinjaRMMAgent*).UninstallString Start-Process -FilePath "$UninstallString" -ArgumentList "--mode unattended"
  1. Load more activity
×
×
  • Create New...