josverl / connect-o365 Goto Github PK
View Code? Open in Web Editor NEWConnect to Office 365 and most related services and get ready to admin with Powershell.
License: MIT License
Connect to Office 365 and most related services and get ready to admin with Powershell.
License: MIT License
Suggest to add Userprofile directly withouth a dependency on OfficePNP ?
Save the following text to a text file. For example, you could save it to a file named GetOD4BSites.txt.
$AdminURI = "https://-admin.sharepoint.com"
$AdminAccount = ""
$AdminPass = ""
$LogFile = 'C:\Users\youralias\Desktop\ListOfMysites.txt'
$loadInfo1 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
$loadInfo2 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
$loadInfo3 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.UserProfiles")
$sstr = ConvertTo-SecureString -string $AdminPass -AsPlainText –Force
$AdminPass = ""
$creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($AdminAccount, $sstr)
$proxyaddr = "$AdminURI/_vti_bin/UserProfileService.asmx?wsdl"
$UserProfileService= New-WebServiceProxy -Uri $proxyaddr -UseDefaultCredential False
$UserProfileService.Credentials = $creds
$strAuthCookie = $creds.GetAuthenticationCookie($AdminURI)
$uri = New-Object System.Uri($AdminURI)
$container = New-Object System.Net.CookieContainer
$container.SetCookies($uri, $strAuthCookie)
$UserProfileService.CookieContainer = $container
$UserProfileResult = $UserProfileService.GetUserProfileByIndex(-1)
Write-Host "Starting- This could take a while."
$NumProfiles = $UserProfileService.GetUserProfileCount()
$i = 1
While ($UserProfileResult.NextValue -ne -1)
{
Write-Host "Examining profile $i of $NumProfiles"
$Prop = $UserProfileResult.UserProfile | Where-Object { $_.Name -eq "PersonalSpace" }
$Url= $Prop.Values[0].Value
if ($Url) {
$Url | Out-File $LogFile -Append -Force
}
$UserProfileResult = $UserProfileService.GetUserProfileByIndex($UserProfileResult.NextValue)
$i++
}
Write-Host "Done!"
For those of us who generally only connect to one Office365 instance, it'd be great to not have to specify the account all the time. Similarly, it makes scripts more portable if I'm not specifying the account all the time.
Similarly, if I mostly connect to exchange, I'd like to be able to connect to it without specifying -EXO
Currently the configuration is stored as a JSON string as part of the script.
The goal is to externalize this data and store it on GitHub for better maintenance.
the assumption is that when installation is needed, the machine that can perform the installation does have access to the internet to download the modules.
I am getting the below error when running Connect-O365.ps1 -Install. The ConnectO365 module has already been installed as per the Powershell gallery instructions.
Get-O365ModuleFile : The term 'Get-O365ModuleFile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Scripts\Connect-O365.ps1:609 char:9
Get-O365ModuleFile
~~~~~~~~~~~~~~~~~~
Is there any reason why this is a script rather than a module?
It does seem a bit strange when tab-completing to have the .ps1 on the end of the command.
It also means I can depend on this module in my own modules down the line
that is aliased to Connect-O365 -Close
It seems the "powershell way" to do it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.