#StackBounty: #active-directory #powershell #windows-server-2012 #cluster windows cluster – Service Principle Name but no cluster servi…

Bounty: 50

Hello I used to detect which servers in our big environment are clusters or cluster nodes by checking
get-adcomputer value ServicePrincipalName if there is string MSServerClusterMgmtAPI or MSServerCluster.
However I am not sure if that should mean that there should be ClusSvc Cluster Service running, because now I found some servers without this service, but with such string in ServicePrincipalName in their AD object. So what does it mean? Are these not in cluster or were they before and it was uninstalled, but this value didn’t change?


Get this bounty!!!

#StackBounty: #sharepoint-online #development #powershell #sharepoint-rest-api #site-template Is there a way to save a site in SharePoi…

Bounty: 50

I have a SharePoint Online site that has custom scripts enabled, and I want to programmatically save it as a template. I do not want to use PnP Provisioning Templates, I want to access the same functionality as savetmpl.aspx but programmatically. I know that in SharePoint Server you can use the SPWeb.SaveAsTemplate method in PowerShell or C#, but this is not present in SharePoint Online. Is there a way to do this?

I also found the following url: https://mytenant-admin.sharepoint.com/_vti_bin/sites.asmx. I see ExportWeb listed there. Would this work in SharePoint Online?

I looked at this question, but I do not want to use PnP Provisioning


Get this bounty!!!

#StackBounty: #powershell #cmd.exe #windows-server #windows-services A privilege that the service requires to start doesn't exist i…

Bounty: 50

Using CarbonDLLs and sc config I am able to grant the user Logon As Service rights and also able to add the user as the Services’ Log on as account.

Previously I was getting Logon Failure but after using carbon and powershell script I was able to remove that error by granting Logon as Service permission to the account.

But now when I start the service I get the following error:

A privilege that the service requires to start does not exist in the Service Account....

For Service Account I’m using a user account from AD which is also added as a Local Administrator on the server on which I am changing the services’ log on as account.

For testing I was changing the Logon As Account of Themes service which by default runs under the Local System Account. I don’t want to run it under Local System but under the Account Ive assigned


Get this bounty!!!

#StackBounty: #sharepoint-online #powershell #document-library #export #wsdl Can ExportWeb (from sites.asmx) be performed in SharePoint…

Bounty: 50

I am a global administrator in my tenant, and I am trying to run the ExportWeb method from https://mytenant-admin.sharepoint.com/_vti_bin/sites.asmx in SharePoint Online. When I run the following script, I get the response 3, and I learned from the comments of this article that 3 means that an argument is invalid. Can anybody tell me what I am doing wrong? The only thing I can think of is that this does not work in SharePoint Online.

Prerequisite: I want to export https://mytenant.sharepoint.com/sites/siteA to the document library at https://mytenant.sharepoint.com/sites/siteB/Shared%20Documents/Forms/AllItems.aspx. Both locations already exist, both sites are modern team sites, and I have confirmed that there is enough space for the operation. I have tried the script both with the ending /Forms/AllItems.aspx and without it.

PowerShell I Ran:

$cred=Get-Credential #I used my SharePoint Online global admin credentials
$svc=New-WebServiceProxy -Uri "https://mytenant-admin.sharepoint.com/_vti_bin/Sites.asmx?WSDL" -Credential $cred
$svc.ExportWeb("siteExportJob", "https://mytenant.sharepoint.com/sites/SiteA", "https://mytenant.sharepoint.com/sites/SiteB/Shared%20Documents/Forms/AllItems.aspx", $true, $true, $false, 1024)  

I looked at this question, but it never received an answer.


Get this bounty!!!

#StackBounty: #windows-10 #powershell #permissions #windows-search How to set WindowsSafeSearchSetting to Off?

Bounty: 100

When I execute Get-WindowsSearchSetting in PowerShell, it tells me that WindowsSafeSearchSetting is set to Strict.

I want to change that setting to Off, but when I execute Set-WindowsSearchSetting -SafeSearchSetting "Off", I get this error:

WindowsSafeSearchSetting: Can't choose this setting. 
It's been set by Family Safety.

I’m using an Admin PowerShell console, and I don’t have any "Family Safety" settings turned on (afaik that’s a microsoft account thing, where you can register your account as part of a family, I haven’t done that).


Get this bounty!!!

#StackBounty: #powershell #cmd.exe #automation #network-adapter #network-interface How to automate the process of sharing internet betw…

Bounty: 50

I use a VPN for my console, and I do this by starting a VPN connection on my laptop and sharing the VPN internet adapters internet with my Ethernet adapter.

The issue is that upon reboot, errors sometimes occur and I need to un-share the adapters internet connection and then re-share it. This becomes progressively more annoying every time I need to do it. Does anyone know a command/powershell solution to automate this process?


Get this bounty!!!

#StackBounty: #excel #powershell Imported .csv file with formulas

Bounty: 50

I have imported a comma seperated csv file using powershell.
I gets imported and looks as it should. The problem is, the cells contain formulas.
Like =20+50+70. It doesn’t get calculated unless i click enter i the top field.
Another problem is, that some of the cells contains numbers like =50,2+70,5. These cells excel doesn’t understand at all. It can’t caltulate them, unless i remove the , or replace it with a dot (.). But this is not a possibility.
How to i fix this?
The csv file is imported with powershell using this:

[threading.thread]::CurrentThread.CurrentCulture = 'en-US'
$wbpath=Join-Path "$psscriptroot" 'file.xlsx'
$importcsv=Join-Path "$psscriptroot" 'file.csv'
$xl = New-Object -ComObject Excel.Application
$xl.Visible = $false
$xl.Workbooks.OpenText($importcsv)
$xl.DisplayAlerts = $false
[threading.thread]::CurrentThread.CurrentCulture = 'en-US'
$xl.ActiveWorkbook.SaveAs($wbpath,51)
$xl.Quit()
while([System.Runtime.Interopservices.Marshal]::ReleaseComObject($xl)){'released'}

The

[threading.thread]::CurrentThread.CurrentCulture = 'en-US'

is necessary or i will get errors because my system locale is not us.

Thank you.

CSV Sample:

name1.name1.name1,"=20","=7,65","=20,01"
name2.name2.name2,"=20+10","=4,96+0,65","=20,01+10"
name3.name3.name3,"=20","=4,96+0,88","=21,01+11"


Get this bounty!!!

#StackBounty: #powershell #raid #windows-server-2012 #repair #storage-spaces Virtual disk still shows up as degraded after repair

Bounty: 100

On a machine running Windows Server 2012 R2, I have a virtual disk consisting of 8 physical disks in a parity configuration. One drive died, so I replaced the dead drive and followed these instructions for repairing the virtual disk: Replacing a Failed Disk in Windows Server 2012 R2 Storage Spaces with PowerShell.

Everything seemed to be working great, with one discrepancy: despite completing the whole repair process with no errors, the virtual disk still is marked as “degraded”, even though it once again has 8 healthy drives. What gives?

The file system on the virtual drive (which is backed up) is still accessible, but I’d like to know if I again have resiliency against a drive failure or not, but I can’t find any information about why the virtual disk is still degraded, or how to determine if it really is degraded, or how to fix it.

Here is some powershell output that I hope will be useful. Thank you!

Powershell output - see text copy below

And again as text:

PS C:UsersAdministrator> Get-StoragePool

FriendlyName            OperationalStatus       HealthStatus            IsPrimordial            IsReadOnly
------------            -----------------       ------------            ------------            ----------
Z                       OK                      Healthy                 False                   False
Primordial              OK                      Healthy                 True                    False


PS C:UsersAdministrator> Get-VirtualDisk

FriendlyName        ResiliencySettingNa OperationalStatus   HealthStatus        IsManualAttach                     Size
                    me
------------        ------------------- -----------------   ------------        --------------                     ----
Z                   Parity              Degraded            Warning             False                          25.46 TB


PS C:UsersAdministrator> $zdisk = Get-VirtualDisk | Where-Object { $_.FriendlyName -eq 'Z' }
PS C:UsersAdministrator> Get-PhysicalDisk -VirtualDisk $zdisk

FriendlyName        CanPool             OperationalStatus   HealthStatus        Usage                              Size
------------        -------             -----------------   ------------        -----                              ----
PhysicalDisk5       False               OK                  Healthy             Auto-Select                     3.64 TB
PhysicalDisk1       False               OK                  Healthy             Auto-Select                     3.64 TB
PhysicalDisk2       False               OK                  Healthy             Auto-Select                     3.64 TB
PhysicalDisk7       False               OK                  Healthy             Auto-Select                     3.64 TB
PhysicalDisk6       False               OK                  Healthy             Auto-Select                     3.64 TB
PhysicalDisk8       False               OK                  Healthy             Auto-Select                     3.64 TB
PhysicalDisk3       False               OK                  Healthy             Auto-Select                     3.64 TB
PhysicalDisk4       False               OK                  Healthy             Auto-Select                     3.64 TB


PS C:UsersAdministrator>

In case it matters, PhysicalDisk4 is the new replacement disk that I added to replace the dead disk.


Get this bounty!!!