Unable to change the Ranking Model used in SharePoint Online - powershell

I'm in a SharePoint Online tenancy that has an Office 365 Business Essential license. As I understand, the managing of the Ranking Model is done through the SharePoint Online Management Shell. I've downloaded the application and am able to login into our tenancy without error.
Everything I've found online to help me either change or even check the configuration of the Ranking Model results in an error that the term is not recognized as the name of a cmdlet.
Example:
https://yuriburger.net/2011/08/25/changing-sharepoint-2010-search-ranking-model/
States I can check which models are registered with our Search Service Application by entering the following cmdlet.
Get-SPEnterpriseSearchRankingModel -SearchApplication "Search Service Application"
I receive the following error.
*Get-SPEnterpriseSearchRankingModel : The term 'Get-SPEnterpriseSearchRankingModel' 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 line:1 char:1
+ Get-SPEnterpriseSearchRankingModel -SearchApplication "Search Service Applicatio ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-SPEnterpriseSearchRankingMo
del:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException*
In addition, if I enter "Help" it provides a list of available cmdlets, the cmdlets the documentation I find aren't ever listed. If I try to enter a help Get-SPEnterpriseSearchRankingModel or other recommended cmdlets, I receive a stackoverflow error message and the Shell module crashes.
Am I getting these results because of the limitations of the Business Essentials license or do I just not have something installed?

Sharepoint Online doesn't support that cmdlet. See list of available cmdlets: https://technet.microsoft.com/en-us/library/fp161364.aspx
In fact, there are very few PowerShell cmdlets for Sharepoint Online. This is probably due to the fact that it's a lot more complicated to write cmdlets for the server-infrastructure in Azure/O365 vs. on-premise Exchange 2013 with direct database-access.
See this article for comparison between Sharepoint 2013 and Sharepoint Online. It's from 2013, but looking at the cmdlets-list on TechNet, it doesn't look like much has changed: https://blog.blksthl.com/2013/01/15/sharepoint-2013-powershell-cmdlets-listed-onprem-vs-online/#365
Looks like you would have to do this using the Admin Center (GUI).

Related

"Add-UnifiedGroupLinks is not recognized.." even though ExchangeOnlineManagement 2.0.5 is definitely installed

I'm semi-new to PowerShell, so please excuse if I mix up some terminology. I need to manage M365-Groups via PS. I've inherited a productive machine which had a very old ExchangeOnlineModule installed (v. 0.4578.0). This version did allowed me to read the M365-Group members via get-unifiedGroupLinks -identity "zzz.test" -LinkType Members, but not to add members.
Next installed the latest productive version of the ExchangeOnlineMangement module according to MS' manual.
The command
Get-InstalledModule
shows me version 2.0.5.
The command
Get-Module -ListAvailable
shows both old an new version, installed in "Directory: C:\Program Files\WindowsPowerShell\Modules"
When I now try to run the following Add-command, I receive the error below:
Add-UnifiedGroupLinks -Identity "zzz.test" -LinkType Members -Links "mytestuser#mydomain.com"
Add-UnifiedGroupLinks : The term 'Add-UnifiedGroupLinks' 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 line:1 char:1
+ Add-UnifiedGroupLinks -Identity "zzz.test" -LinkType Members -Link ...
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-UnifiedGroupLinks:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Same after I "manually" import that specific module version with "Import-Module".
Can anyone help me understand why this command works on my test machine, but is simply not recognized on this one? I already restarted that productive machine after the installation.
Thank you in advance & best regards
MK
Figured it with testing: The issue was insufficient access rights in AzureAD for the user used to connect to Exchange Online.
It would seem that the module only loads the commands for which you have the access rights to use into the connected session. Therefor, when you try to use such a command (like Add-UnifiedGroupLins) you get a "Term is not recognized" error, instead of something meaningfull.
For those who care: It worked for me after adding the Exchange administrator role and, obviously, with the Global administrator role. Maybe there is a lesser role that is sufficient, but I haven't found it.

Powershell connecting to Sharepoint online using Active directory

To start, I am using Windows 7, I am a full adminstrator on this machine
I have tried other machines and ran as an administrator as well
I am only a sharepoint site collection admin
In powershell we connect to Sharepoint online. during this process, if I use Connect-PnPOnline -Url $masterSiteUrl -useweblogin, I get prompted for a username, however the next screen is blank and stays there.
when I do a view source of that page I get
d>Redirecting....myshn.net/certcheck" method="POST">
I do have scripting enabled and sometimes I get a certificate issue, I have clicked "Install Certificate" although I am not sure what it did, but it still doesnt work
Ive also tried -SPOManagementShell and -ClearTokenCache
and get the following error
Connect-PnPOnline : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Connect-PnPOnline -Url $masterSiteUrl -useweblogin -spoManagementShel ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Connect-PnPOnline], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,SharePointPnP.PowerShell.Commands.Base.ConnectOnline
See this:
Connect to all Office 365 services in a single Windows PowerShell
and this...
Connect to all Office 365 Services PowerShell - Supports MFA too
Using our All-in-One PowerShell script, you can connect to all Office
365 Services using a single cmdlet. It supports both MFA and non-MFA
account -Exchange Online -Azure AD -SharePoint Online -Skype for
Business Online -Security & Compliance Center -Teams
Download: ConnectO365Services.ps1
O365_Logon 1.1
O365 logon cmdlets to assist IT administrators. In this module, there
are several cmdlets that simplify the process of logging onto various
O365 components.

how to create high trust SharePoint Add-ins?

I am working on SharePoint add-in to create high trusted app. I am trying to create SharePoint add-in using certificates. I took Create high-trust SharePoint Add-ins as the reference. I have successfully generated .pfx and .cer file. Now, the next step is to configure SharePoint. I have opened my SharePoint Online Management Shell in Administrator mode. I executed these 2 lines successfully.
$publicCertPath = "C:\Certs\HighTrustSampleCert.cer"
$certificate = New-Object
System.Security.Cryptography.X509Certificates.X509Certificate2($publicCertPath)
As soon as i entered New-SPTrustedRootAuthority -Name "HighTrustSampleCert" -Certificate $certificate, I got the following exception.
New-SPTrustedRootAuthority : The term 'New-SPTrustedRootAuthority' 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 line:1 char:1
+ New-SPTrustedRootAuthority -Name "HighTrustSampleCert" -Certificate $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-SPTrustedRootAuthority:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I don't know, why am I getting this error. Is there any other way to generate high trusted SharePoint add-in?
High-trust add-in cannot be installed to Microsoft SharePoint Online, you need use low-trust for SharePoint online.

Azure Powershell - get-AzureVM returning an accountName does not exist error?

I'm at a bit of a loss with where to start with this one.
I have one Azure account with 2 subscriptions (I'm not the full admin just a co-admin so can't edit them) and both are called Pay-As-You-Go with different IDs.
I can connect powershell to the account and log in, list the subscriptions, select the subscription that I want to use.
However when I issue the get-AzureVM command either in a script or from the
command line I get the error below:
Get-AzureVM : Account with name 'Pay-As-You-Go' does not exist.
Parameter name: accountName
At line:1 char:1
+ Get-AzureVM
+ ~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureVM], ArgumentException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.GetAzureVMCommand
I can enter a specific VM name and service name and get the same error back.
My confusion stems from the fact that I haven't specified that account name as far as I'm aware in the command.
I have been playing around on the machine quite a lot this morning with writing wrapper scripts to allow selection of different user name connections via a prompt and selection of the relevant subscription but nothing I'm aware would have affected this command.
I can still run the commands below and get the output I expect:
Get-AzureAccount
Get-AzureSubscription -current
So the session is working for sure.
The VM I am trying to query was created from a custom image this morning and I can RDP to it and it seems to be running normally
Any ideas would be great?
The best way to do that it is to Execute the command Clear-AzureProfile it will require you to login again the problem it is that you account has been logged out. The sam problem happens when you have 2 different subscription for 2 different accounts and you change from one to another after executing some commands on the first one. Using the clear command after the switch solves that.
Well, I'm not sure of the root cause of this one, restarting the machine, opening closing the IDE etc had no effect.
But I did find by running Remove-AzureAccount and then running Add-AzureAccount again that it resolved.
So I just removed my account from powershell and re-added it to solve...

Set-SPBusinessDataCatalogThrottleConfig : Cannot bind parameter 'Identity'

If you are working with a larger external list (more than 2000 items) in dev environment it works perfectly, but when you work in production environment, it throws error
"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator. Correlation ID: ...........".
So start to working to fix the BCS limit through powershell.
When I enter below command in powershell I get error in cmd. Any idea?
PS C:\Program Files\Nintex\Nintex Workflow 2010> Set-SPBusinessDataCatalogThrott
leConfig -Identity Get-SPBusinessDataCatalogThrottleConfig -Scope ThrottleType I
tems Database-GUID-ServiceApplicationProxy 5222b2db-fdd1-43f5-accb-7f039155f654-
8000-default maximum 6000
Set-SPBusinessDataCatalogThrottleConfig : Cannot bind parameter 'Identity'. Can
not convert the "Get-SPBusinessDataCatalogThrottleConfig" value of type "System
.String" to type "Microsoft.SharePoint.BusinessData.SharedService.ThrottleConfi
g".
At line:1 char:50
+ Set-SPBusinessDataCatalogThrottleConfig -Identity <<<< Get-SPBusinessDataCat
alogThrottleConfig -Scope ThrottleType Items Database-GUID-ServiceApplicationPr
oxy 5222b2db-fdd1-43f5-accb-7f039155f654-8000-default maximum 6000
+ CategoryInfo : InvalidArgument: (:) [Set-SPBusinessDataCatalogT
hrottleConfig], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.SharePo
int.BusinessData.SharedService.SPSetSPBusinessDataCatalogThrottleConfig
At first glance there seems to be some issues in your PowerShell syntax. You specify another cmdlet as value for the -Identity parameter, and that won't work. Sharepoint is not really my expertise, but this article by lionelro on the msdn blogs looks like a good place to start. Especially since the start of the article describes your issue online appearing on the production environment. Hope it helps.