{"id":434,"date":"2021-01-08T11:46:27","date_gmt":"2021-01-08T10:46:27","guid":{"rendered":"https:\/\/blog.van-daag.nl\/?p=434"},"modified":"2021-01-08T11:46:28","modified_gmt":"2021-01-08T10:46:28","slug":"o365-powershell-connect-once","status":"publish","type":"post","link":"https:\/\/van-daag.nl\/?p=434","title":{"rendered":"O365 &#8211; Powershell connect once"},"content":{"rendered":"\n<p>Because I&#8217;m testing I made this, so I dont need to fill in everytime the credentials, but checks if there is a connection.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">AzureAD Connect<\/h3>\n\n\n\n<p>if($azureConnection.Account -eq $null){<br>$azureConnection = Connect-AzureAD<br>}<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">MSO Connect Check<\/h5>\n\n\n\n<p>if( $credential -eq $null){<br>$credential = Get-Credential<br>Connect-MsolService -Credential $credential<br>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Because I&#8217;m testing I made this, so I dont need to fill in everytime the credentials, but checks if there is a connection. AzureAD Connect if($azureConnection.Account -eq $null){$azureConnection = Connect-AzureAD} MSO Connect Check if( $credential -eq $null){$credential = Get-CredentialConnect-MsolService -Credential $credential}<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-434","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=434"}],"version-history":[{"count":1,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/434\/revisions"}],"predecessor-version":[{"id":435,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/434\/revisions\/435"}],"wp:attachment":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}