
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2019 12:00 AM
New Action for PCs
Action line:
powershell.exe "{actionpath}ChangePCName.ps1" {smartname}
ChangePCName.ps1: (Make sure Encoding is right, like UCS2_LE or something, and of course, save in your action path)
param([String]$oldname)
$newname=Read-Host -Prompt "Input new Name and click [Enter]"
Rename-computer –computername $oldname –newname "$newname" –domaincredential [domainname]\administrator -force -restart
It'll come up with a shell asking for the new name you want it to be, then ask for your administrator password, or whatever user has rights to change the PC name, then that PC will restart.
Action line:
powershell.exe "{actionpath}ChangePCName.ps1" {smartname}
ChangePCName.ps1: (Make sure Encoding is right, like UCS2_LE or something, and of course, save in your action path)
param([String]$oldname)
$newname=Read-Host -Prompt "Input new Name and click [Enter]"
Rename-computer –computername $oldname –newname "$newname" –domaincredential [domainname]\administrator -force -restart
It'll come up with a shell asking for the new name you want it to be, then ask for your administrator password, or whatever user has rights to change the PC name, then that PC will restart.
Labels:
- Labels:
-
Custom Actions
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2019 11:28 AM
Great, thank you!
There's one thing you must change on your local computer that you're running Lansweeper from and that is to open PowerShell as an administrator and run this command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Otherwise it won't run the action from the web browser on your PC.
There's one thing you must change on your local computer that you're running Lansweeper from and that is to open PowerShell as an administrator and run this command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Otherwise it won't run the action from the web browser on your PC.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 08:36 PM
max204 wrote:
Great, thank you!
There's one thing you must change on your local computer that you're running Lansweeper from and that is to open PowerShell as an administrator and run this command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Otherwise it won't run the action from the web browser on your PC.
Does this run on the machine hosting Lansweeper, or where I am accessing the website from? Local Computer and "location where Lansweeper is running" are not always the same.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 10:36 PM
max204 wrote:
Does this run on the machine hosting Lansweeper, or where I am accessing the website from? Local Computer and "location where Lansweeper is running" are not always the same.
That's a good question. I'm running everything on localhost, so I'm not too sure where the commands are initiated from. I'm going to go with a logical guess and say its from the server hosting LanSweeper, since its back-end functionality. Please correct me if I'm wrong. I'm curious myself.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2019 07:50 AM
Word of warning don't do on machines connected via Wifi if using a WiFi certificate as it will need to download an updated cert with new name etc.
