Hi, All
I've been working a fair bit on a script that can log on to both Azure and Sharepoint (on office365), access the invoices for my subscriptions in Azure, download those that I don't have, and log off.
I've got this working, on the Azure side, and have a script that will download the invoices, assuming they're not already in existence.
Here's what I have:
Powershell
$User=([adsisearcher]"(samaccountname=$env:username)").FindOne().Properties.mail$Pass=ConvertTo-SecureString"MYPASSWORD"-AsPlainText-Force$AzCredentials=New-ObjectSystem.Management.Automation.PSCredential($user,$Pass)$O365Credentials=New-ObjectMicrosoft.SharePoint.Client.SharePointOnlineCredentials($User,$Pass)#Sharepoint Stuff$SiteURL="https://Library directory URL"$Context=New-ObjectMicrosoft.SharePoint.Client.ClientContext($SiteURL)#Log in...