Jump to content

xben

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by xben

  1. Hi Guys, I though I would begin to write a couple of post on how I manage certain things in Pulseway. I love Pulseway it is a good product so far but some features are lacking and those scripts makes life way easier, at least for me. If you find that post helpful let me know and I will post more of my scripts on how I manage stuff. You are also more then welcome to let me know how you do it or any amelioration suggestions. Disclaimer : I am not a programmer at all so bare whit me on the coding part LOL To name computers I though it was essential that I could put a description in it so I made a custom field noteinname for Per Systems. So when I need to have a description on the machine I add the custom field to it. In that example LAB VM. Then I also thought that I really wanted the username in the name and Pulseway support gave me a script for that but when no user are logged in it removes the name. So I script it to put the last logged in user if no users were logged in. That way you can also search for the username when looking for an agent. Here is the script I use. After that I created a task to rename the computers every day. That's it. Works perfectly. $user1 = quser | Select-Object -skip 1 #Adds a - to $notes if not empty if (!$notes){ write-output "-- Not modifying variable Notes NULL" }else{ write-output "-- Notes not NULL adding a -" $notes= "-$notes" } if (!$user1) { write-output '-- No user connected applying lastlogged user' $user2 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI' -Name LastLoggedOnUser ` | Select-Object -ExpandProperty LastLoggedOnUser $user2mod = $user2 -creplace '^[^\\]*\\', '' write-output "-- Name to be applied $env:computername$notes-$user2mod" Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value "$env:computername$notes-$user2mod" } else { write-output '-- A user is logged applying logged username' $user1mod = $user1.substring(1,22).Trim() -join "," write-output "-- Name to be applied $env:computername$notes-$user1mod" Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value "$env:computername$notes-$user1mod" } Here is the result. Hope this helps ! Cheers.
  2. Hi JKchess, Did you find an answer to this question ? Personnaly what I did is configure a Automation - Workflows whit the New system detected and added a script in there to delete the shortcut. I also added a couple of script to install default stuff or certain policies I want for Windows Workstation. Here is the delete script. It will delete the shortcut form the public folder and list all the users folder to delete it. Hope this help. ___________________________________________________________________________________________________________________________ REM delete from Public Desktop del /s "C:\Users\Public\Desktop\Pulseway Manager.lnk" /f /q REM delete from All Users Desktop del /s /q C:\windows\temp\list_dirs.txt dir /b C:\users\* > C:\windows\temp\list_dirs.txt FOR /F "tokens=*" %%I IN ('type C:\windows\temp\list_dirs.txt') DO del /S /Q "C:\Users\%%I\desktop\Pulseway Manager.lnk" del /s /q C:\windows\temp\list_dirs.txt ____________________________________________________________________________________________________________________________
×
×
  • Create New...