From c32bb35f1ceb3867b159db2c82adf3e0ef3ad62a Mon Sep 17 00:00:00 2001 From: silversword411 Date: Tue, 16 Mar 2021 17:10:23 -0400 Subject: [PATCH 1/3] Added Rename Computer Community Script --- api/tacticalrmm/scripts/community_scripts.json | 7 +++++++ scripts/Rename_Computer.ps1 | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 scripts/Rename_Computer.ps1 diff --git a/api/tacticalrmm/scripts/community_scripts.json b/api/tacticalrmm/scripts/community_scripts.json index bfaa2fcd23..cec0fd1d43 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 0000000000..5a17ae68bc --- /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 From 9db497092f40304de6e724b34081d478af49a210 Mon Sep 17 00:00:00 2001 From: silversword411 Date: Thu, 18 Mar 2021 00:38:40 -0400 Subject: [PATCH 2/3] Update Rename_Computer.ps1 --- scripts/Rename_Computer.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/Rename_Computer.ps1 b/scripts/Rename_Computer.ps1 index 5a17ae68bc..98b8b7eb6f 100644 --- a/scripts/Rename_Computer.ps1 +++ b/scripts/Rename_Computer.ps1 @@ -3,6 +3,11 @@ # First Command Parameter will be new computer name # Second Command Parameter if yes will auto-restart computer +if ($Args.Count -eq 0) { + Write-Output "Computer name arg is required" + exit 1 +} + $param1=$args[0] $ToRestartTypeYes=$args[1] @@ -11,4 +16,4 @@ 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 +} From a11e61732203d0de7cadf2ba6c23d0677c26d667 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 19 Mar 2021 05:21:37 +0000 Subject: [PATCH 3/3] bump versions --- api/tacticalrmm/tacticalrmm/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index fe07e3f789..d9a41a9d4c 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -15,14 +15,14 @@ AUTH_USER_MODEL = "accounts.User" # latest release -TRMM_VERSION = "0.4.26" +TRMM_VERSION = "0.4.27" # bump this version everytime vue code is changed # to alert user they need to manually refresh their browser APP_VER = "0.0.122" # https://github.com/wh1te909/rmmagent -LATEST_AGENT_VER = "1.4.12" +LATEST_AGENT_VER = "1.4.13" MESH_VER = "0.7.88"