Open davidjamesbc opened 8 years ago
Not sure what you’re doing wrong but I just did this quick test and it works for me:
$cred = Get-Credential
$ctx = connect-sposite -Url "https://falchiontest.sharepoint.com" -Credential $cred
$ts = Get-SPOTermStore
From: davidjamesbc [mailto:notifications@github.com] Sent: Wednesday, May 11, 2016 9:00 AM To: glapointe/PowerShell-SPOCmdlets PowerShell-SPOCmdlets@noreply.github.com Subject: [glapointe/PowerShell-SPOCmdlets] Connect-SPOSite not working with Get-SPOTermStore (#1)
Running the script below.
When statement is reached; Connect-SPOSite runs and the script stops
It the Connect-SPOSite is then commented out the script runs to completion.
Or am I being dumb?
Add-Type -Path "\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation\Microsoft.SharePoint.Client.dll" Add-Type -Path "\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation\Microsoft.SharePoint.Client.Runtime.dll" Add-Type -Path "\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation\Microsoft.SharePoint.Client.Taxonomy.dll" Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking Import-Module "C:\Program Files (x86)\Falchion Consulting, LLC\SharePoint Online PowerShell\Lapointe.SharePointOnline.PowerShell\Lapointe.SharePointOnline.PowerShell.dll" -DisableNameChecking
$webappurl = "https://me.sharepoint.com" $adminUrl = "https://me-admin.sharepoint.com" $owner = "me@me.onmicrosoft.com mailto:me@me.onmicrosoft.com " $adminuser = "me@3AE3.onmicrosoft.com mailto:me@3AE3.onmicrosoft.com "
Script will exist after this; must run once and then comment out
$TermStore = Get-SPOTermStore -Identity 0
New-SPOTermGroup -TermStore 0 -Name "Main"
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/glapointe/PowerShell-SPOCmdlets/issues/1 https://github.com/notifications/beacon/AHuNKk345xQckRVq2_4bYPG1OmgFvwUfks5qAe8EgaJpZM4IcK4e.gif
Gary,
Many thanks.
If I use the syntax from your quick test it works perfectly.
If I use the below syntax (Copied from the command reference on your blog) then after Connect-SPOSite is issue the script stops
$username = "admin@contoso.sharepoint.com" PS C:> $password = "password" PS C:> $cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(ConvertTo-SecureString $password -AsPlainText -Force) PS C:> Connect-SPOSite -Url "http://contoso.sharepoint.com/" -Credential $cred
Clearly I have it working now with your kind guidance but I thought I should let you know in case it was helpful your normal quest for perfection!
Do you get any sort of error? All this is doing is hard-coding the username/pwd in the script (something I don’t recommend but helpful in certain situations) and then using that to create the credential object.
From: davidjamesbc [mailto:notifications@github.com] Sent: Wednesday, May 11, 2016 9:57 AM To: glapointe/PowerShell-SPOCmdlets PowerShell-SPOCmdlets@noreply.github.com Cc: Gary Lapointe gary@thelapointes.com; Comment comment@noreply.github.com Subject: Re: [glapointe/PowerShell-SPOCmdlets] Connect-SPOSite not working with Get-SPOTermStore (#1)
Gary,
Many thanks.
If I use the syntax from your quick test it works perfectly.
If I use the below syntax (Copied from the command reference on your blog) then after Connect-SPOSite is issue the script stops
$username = "admin@contoso.sharepoint.com mailto:admin@contoso.sharepoint.com " PS C:> $password = "password" PS C:> $cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(ConvertTo-SecureString $password -AsPlainText -Force) PS C:> Connect-SPOSite -Url "http://contoso.sharepoint.com/" -Credential $cred
Clearly I have it working now with your kind guidance but I thought I should let you know in case it was helpful your normal quest for perfection!
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/glapointe/PowerShell-SPOCmdlets/issues/1#issuecomment-218504433 https://github.com/notifications/beacon/AHuNKgE6w2dQ7Ek7mG-xvduolqCfay5Uks5qAfxLgaJpZM4IcK4e.gif
Full output from the Powershell ISE command window below. Using windows 10
PS Microsoft.PowerShell.Core\FileSystem::\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation> \vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation\GetTSTest.ps1
Context Url
Lapointe.SharePointOnline.PowerShell.CmdletContext https://me.sharepoint.com/
PS Microsoft.PowerShell.Core\FileSystem::\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation>
Once I comment out the #connect-sposite and re-run I can see the term store id,name contenttypepub hub properties etc.
Strange
Running the script below.
When statement is reached; Connect-SPOSite runs and the script stops
It the Connect-SPOSite is then commented out the script runs to completion.
Or am I being dumb?
Add-Type -Path "\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation\Microsoft.SharePoint.Client.dll" Add-Type -Path "\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation\Microsoft.SharePoint.Client.Runtime.dll" Add-Type -Path "\vmware-host\Shared Folders\projects\ProductDevelopment\LiteBrand\Source\LiteCreation\Microsoft.SharePoint.Client.Taxonomy.dll" Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking Import-Module "C:\Program Files (x86)\Falchion Consulting, LLC\SharePoint Online PowerShell\Lapointe.SharePointOnline.PowerShell\Lapointe.SharePointOnline.PowerShell.dll" -DisableNameChecking
$webappurl = "https://me.sharepoint.com" $adminUrl = "https://me-admin.sharepoint.com" $owner = "me@me.onmicrosoft.com" $adminuser = "me@3AE3.onmicrosoft.com"
Script will exist after this; must run once and then comment out
connect to SharePoint Online
Lapointe.SharePointOnline.PowerShell\Connect-SPOSite -Url $webappurl"/sites/Inform" -Credential $adminuser
$TermStore = Get-SPOTermStore -Identity 0
New-SPOTermGroup -TermStore 0 -Name "Main"