cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TonyMcg1
Frequent Visitor

Mange which Environment is in which DLP with PowerShell - and remove from Tenant DLP

Looking to automate the admin tasks we hav eto do in our powerplatform.

Using powershell to add th ecommans to our pipline.

I can see th ecommand to to create DLPs and add connectors to DLPs liek this:

 

Add-ConnectorToBusinessDataGroup -PolicyName 'PolicyName' –ConnectorName 'ConnectorName'

 

But cannot see a PowerShell command to assign Enviroments to a DLP, remove an Environment form a DLP.

Exclude Environment form Tenant DLP.

 

Does anyone have details on to do this with PowerShell?

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

You can use the Set-AdminDlpPolicy to create include or exclude filters on environments.  Here are some examples

-------------------------- EXAMPLE 2 --------------------------
    
    PS C:\>Set-AdminDlpPolicy -PolicyName 78d6c98c-aaa0-4b2b-91c3-83d211754d8a -FilterType Include -Environments 
    "febb5387-84d7-4717-8345-334a34402f3d,83d98843-bfd7-47ef-bfcd-dc628810ae7b"
    
    Only applies the policy to the environments febb5387-84d7-4717-8345-334a34402f3d and 
    83d98843-bfd7-47ef-bfcd-dc628810ae7b.
    
    
    
    
    -------------------------- EXAMPLE 3 --------------------------
    
    PS C:\>Set-AdminDlpPolicy -PolicyName 78d6c98c-aaa0-4b2b-91c3-83d211754d8a -FilterType Exclude -Environments 
    "febb5387-84d7-4717-8345-334a34402f3d,83d98843-bfd7-47ef-bfcd-dc628810ae7b"
    
    Applies the policy to all environments except febb5387-84d7-4717-8345-334a34402f3d and 
    83d98843-bfd7-47ef-bfcd-dc628810ae7b.


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

You can use the Set-AdminDlpPolicy to create include or exclude filters on environments.  Here are some examples

-------------------------- EXAMPLE 2 --------------------------
    
    PS C:\>Set-AdminDlpPolicy -PolicyName 78d6c98c-aaa0-4b2b-91c3-83d211754d8a -FilterType Include -Environments 
    "febb5387-84d7-4717-8345-334a34402f3d,83d98843-bfd7-47ef-bfcd-dc628810ae7b"
    
    Only applies the policy to the environments febb5387-84d7-4717-8345-334a34402f3d and 
    83d98843-bfd7-47ef-bfcd-dc628810ae7b.
    
    
    
    
    -------------------------- EXAMPLE 3 --------------------------
    
    PS C:\>Set-AdminDlpPolicy -PolicyName 78d6c98c-aaa0-4b2b-91c3-83d211754d8a -FilterType Exclude -Environments 
    "febb5387-84d7-4717-8345-334a34402f3d,83d98843-bfd7-47ef-bfcd-dc628810ae7b"
    
    Applies the policy to all environments except febb5387-84d7-4717-8345-334a34402f3d and 
    83d98843-bfd7-47ef-bfcd-dc628810ae7b.


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

TonyMcg1
Frequent Visitor

This is great Thank you.

we will get testing this next week

 

Thank you again

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,708)