We are here to help!

Find new ways to use Atera, Ask us anything.

Follow

Run Powershell Script

In order run a PowerShell Script, you need to upload a PowerShell ( *.ps1 ) file into the Scripts repository, which can be found under Admin > Scripts.

Example: A Common PowerShell Script, a user password-age report, saved as an HTML file:

PS C:\> Get-ADUser -Filter "Enabled -eq 'True' -AND

PasswordNeverExpires -eq 'False'" -Properties

PasswordLastSet,PasswordNeverExpires,PasswordExpired |

Select DistinguishedName,Name,pass*,@{Name="PasswordAge";

Expression={(Get-Date)-$_.PasswordLastSet}} |sort

PasswordAge -Descending | ConvertTo-Html -Title

"Password Age Report" | Out-File c:\Work\pwage.htm

There are two ways to deploy the script:

  1. Immediately from Agent page > Manage > Scripts
  2. Automated profile

 

To create a script, follow the steps below:

 1. From the left hand panel click Admin
 
 2. Then click Scripts
 Note: You can also access the menu from the Devices page.
 The Scripts page displays.
 
 3. Click Add Script
 The Add Script dialog box displays.
 
4. Upload the script file from your PC ( *.bat, *.msi, *.exe, *.ps1 ) and click Add
To apply the script to an Agent:
5. From the left hand panel click Devices
6. Under the required Agent's Manage menu click Run Script
The Run Script dialog box displays
Click Submit

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request