# Sign powershell scripts?!?!

**URL:** <https://forums.powershell.org/t/sign-powershell-scripts/23082>\
**Category:** PowerShell Help\
**Created:** [November 2, 2023, 4:49pm UTC](https://forums.powershell.org/t/sign-powershell-scripts/23082 "2023-11-02T16:49:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mh7777](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@mh7777](https://forums.powershell.org/u/mh7777)\
**Post date:** [November 2, 2023, 4:49pm UTC](https://forums.powershell.org/t/sign-powershell-scripts/23082/1 "2023-11-02T16:49:46Z")

</div>

I have some PowerShell scripts that will extract data from Intune. Each time you run them you first have to run this command. **Connect-AzureAD** then enter your credentials. How do you bypass that? Is there a way to “sign” scripts? I’ve heard of Graph in Intune? Can anyone show me an example or YouTube video that explains how this is done?  
Thanks.

---

<div class="post-metadata">

**Author:** ![matt-bloomfield](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matt-bloomfield](https://forums.powershell.org/u/matt-bloomfield)\
**Post date:** [November 2, 2023, 6:18pm UTC](https://forums.powershell.org/t/sign-powershell-scripts/23082/2 "2023-11-02T18:18:38Z")

</div>

Script signing and what you’re trying to do aren’t the same thing.

You want to use an App Registration to authenticate. You can use an App Registration with the PowerShell Graph SDK or with the AzureAD module. The latter is planned for deprecation so you should try to work with the Graph SDK wherever possible.

This guide is a good starting point:

> **[Connect to Microsoft Graph PowerShell using an App Registration](https://helloitsliam.com/2022/04/20/connect-to-microsoft-graph-powershell-using-an-app-registration/)**
>
> Connecting to the Microsoft Graph using PowerShell is simple and easy. The most straightforward approach is to pass the required scopes as part of the “Connect-MgGraph”; however, this m…

> **[about Signing - PowerShell](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-7.3)**
>
> Explains how to sign scripts so that they comply with the PowerShell execution policies.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:14pm UTC](https://forums.powershell.org/t/sign-powershell-scripts/23082/3 "2024-05-16T20:14:36Z")

</div>

Closed on May 16, 2024, 8:14pm UTC


