---
title: How To Run PowerShell Scripts
description: Powershell is a powerful scripting language that can automate tasks and manage systems. You can write your own scripts or use existing ones to perform various functions.
---

[Skip to content](https://help.sendmarc.com/how-to-run-powershell-scripts#main-content)

English

Show submenu for translations

[Log a New Ticket](https://help.sendmarc.com/kb-tickets/new?hsLang=en)

[![Sendmarc-Logo-Dark.png\]](https://help.sendmarc.com/hs-fs/hubfs/Sendmarc-Logo-Dark.png?height=24&name=Sendmarc-Logo-Dark.png)](https://help.sendmarc.com?hsLang=en)

- [Home](https://help.sendmarc.com/)
- [View Tickets](https://connect.sendmarc.com/tickets-view)
- [Provide Product Feedback](https://sendmarc.notion.site/29c84b281bbf80868e2fc569ede1b8be?pvs=105)

Open main navigation

Close main navigation

- [Home](https://help.sendmarc.com/)
- [View Tickets](https://connect.sendmarc.com/tickets-view)
- [Provide Product Feedback](https://sendmarc.notion.site/29c84b281bbf80868e2fc569ede1b8be?pvs=105)
- English
  
  Show submenu for translations
- [Log a New Ticket](https://help.sendmarc.com/kb-tickets/new)

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Sendmarc Help Center | DMARC & Email Security Support](https://help.sendmarc.com/?hsLang=en)
2. [Other](https://help.sendmarc.com/other?hsLang=en)
3. [Scripts](https://help.sendmarc.com/other?hsLang=en#scripts)

# How To Run PowerShell Scripts

## Powershell is a powerful scripting language that can automate tasks and manage systems. You can write your own scripts or use existing ones to perform various functions.

### Enable Script Execution

By default, Windows does not allow you to run Powershell scripts for security reasons. You need to change the execution policy to enable script execution. To do this, you need to open a Powershell window as an administrator. You can do this by pressing the Windows key, typing PowerShell, right-clicking on the result, and selecting Run as administrator.

In the PowerShell window, type the following command and press Enter:

```
Set-ExecutionPolicy -Scope Process Unrestricted
```

This command will allow you to run scripts that are not signed by a trusted publisher or downloaded from the internet. This execution policy is only applicable to the current PowerShell session you are running. You can learn more about the execution policies here: [ExecutionPolicy](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.4)

#### Validate Script ExecutionPolicy

To validate your current ExecutionPolicy enter the command below:

```
Get-ExecutionPolicy
```

Your PowerShell Terminal should display the following:

![](https://help.sendmarc.com/hs-fs/hubfs/image-png-Apr-17-2024-01-49-45-7207-PM.png?width=482&height=51&name=image-png-Apr-17-2024-01-49-45-7207-PM.png)

### Locate the Script File

Next, you need to find the path of the script file that you want to run. You can use the File Explorer to navigate to the folder where the script is stored. You can also use the PowerShell commands to change directories and list files. For example, you can use the following commands to go to the Desktop folder and display the files there:

```
cd C:\Users\YourUserName\Desktop
```

```
dir
```

You can also use the tab key to autocomplete the file or folder names. You can also drag and drop the script file from the File Explorer to the Powershell window to get the full path.

### Run PowerShell Script

Finally, you can run the script by typing the following command and pressing Enter:

```
.\ScriptName.ps1
```

The dot and backslash indicate that the script is in the current directory. You can also use the full path of the script if it is in a different location. For example, you can use the following command to run a script that is on the Desktop:

```
C:\Users\YourUserName\Desktop\ScriptName.ps1
```

You may see a warning message that the script is from an untrusted source. This is because the script is not signed by a trusted publisher. You can choose to run the script by typing R and pressing Enter. You can also type N to cancel or A to run all scripts from untrusted sources.

The script will execute and display the output or results in the Powershell window. 

### Need Help?

Sendmarc does not provide any support for PowerShell scripts and are run at your own risk.

- [Portal Guides](https://help.sendmarc.com/portal-guides?hsLang=en#main-content)

    - [Dashboards & Reports](https://help.sendmarc.com/portal-guides?hsLang=en#dashboards-reports)
    - [Data Interpretation](https://help.sendmarc.com/portal-guides?hsLang=en#data-interpretation)
    - [Domain Management](https://help.sendmarc.com/portal-guides?hsLang=en#domain-management)
    - [Account Management](https://help.sendmarc.com/portal-guides?hsLang=en#account-management)
    - [User Management](https://help.sendmarc.com/portal-guides?hsLang=en#user-management)
    - [On-Demand MSP](https://help.sendmarc.com/portal-guides?hsLang=en#on-demand-msp)
    - [Breach Detection](https://help.sendmarc.com/portal-guides?hsLang=en#breach-detection)
- [Partner Portal Guides](https://help.sendmarc.com/partner-portal-guides?hsLang=en#main-content)

    - [Partner Tools](https://help.sendmarc.com/partner-portal-guides?hsLang=en#partner-tools)
- [Other](https://help.sendmarc.com/other?hsLang=en#main-content)

    - [Scripts](https://help.sendmarc.com/other?hsLang=en#scripts)
- [Integrations](https://help.sendmarc.com/integrations?hsLang=en#main-content)

    - [Abnormal](https://help.sendmarc.com/integrations?hsLang=en#abnormal)
    - [ConnectWise](https://help.sendmarc.com/integrations?hsLang=en#connectwise)
    - [Acronis](https://help.sendmarc.com/integrations?hsLang=en#acronis)
    - [HaloPSA](https://help.sendmarc.com/integrations?hsLang=en#halopsa)
    - [Autotask (Datto) (Kaseya)](https://help.sendmarc.com/integrations?hsLang=en#autotask-datto-kaseya)

[![Chill listening crop-3](https://help.sendmarc.com/hs-fs/hubfs/Sendmarc-Logo.png?width=139&height=24&name=Sendmarc-Logo.png "Chill listening crop-3")](https://sendmarc.com/)

Copyright © 2025, Sendmarc