Replies: 2 comments 7 replies
-
Hey @vindi4i |
Beta Was this translation helpful? Give feedback.
7 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to change conditional access policy for SharePoint Online site using PNP.
I did this previously using code:
$url = 'https://companygroup.sharepoint.com/sites/TeamBlockPolicy'
Connect-pnponline $url -useweblogin
$context = Get-PnPContext
$site = Get-PnPTenantSite -Url $url
$site.ConditionalAccessPolicy = [Microsoft.Online.SharePoint.TenantManagement.SPOConditionalAccessPolicyType]::BlockAccess
$site.Update()
Invoke-PnPQuery
Code above not working anymore. When I call $site.Update() I get error:
'Method invocation failed because [PnP.PowerShell.Commands.Model.SPOSite] does not contain a method named 'Update'.'
Command "$site | gm" does not show method 'Update'.
However if I import legacy module SharePointPnPPowerShellOnline everything works fine. .
Could someone explain how conditional access policy for SPO site can be configured using new PNP?
PNP : 1.2.0
SharePointPnPPowerShellOnline 3.29.2101.0
PowerShell : 5.1
Beta Was this translation helpful? Give feedback.
All reactions