diff --git a/api/tacticalrmm/scripts/community_scripts.json b/api/tacticalrmm/scripts/community_scripts.json index bfaa2fcd..cec0fd1d 100644 --- a/api/tacticalrmm/scripts/community_scripts.json +++ b/api/tacticalrmm/scripts/community_scripts.json @@ -236,5 +236,12 @@ "name": "Event Viewer - Check for Bluescreens", "description": "This will check for Bluescreen events on your system", "shell": "powershell" + }, + { + "filename": "Rename_Computer.ps1", + "submittedBy": "https://github.com/silversword411", + "name": "Rename Computer", + "description": "Rename computer. First parameter will be new PC name. 2nd parameter if yes will auto-reboot machine", + "shell": "powershell" } ] diff --git a/scripts/Rename_Computer.ps1 b/scripts/Rename_Computer.ps1 new file mode 100644 index 00000000..5a17ae68 --- /dev/null +++ b/scripts/Rename_Computer.ps1 @@ -0,0 +1,14 @@ +# Chanage the computer name in Windows +# v1.0 +# First Command Parameter will be new computer name +# Second Command Parameter if yes will auto-restart computer + +$param1=$args[0] +$ToRestartTypeYes=$args[1] + +Rename-Computer -newname "$param1" + +# Restart the computer for rename to take effect +if ($ToRestartTypeYes -eq 'yes') { + Restart-Computer -Force +} \ No newline at end of file