Long XML Attributes Relief
If you deal with XML attributes running off the page..
[xml]
Visual Studio has a setting to automatically indent XML attributes!
Long strings automatically turn into the nice auto-indented code below
[xml wrap:true]
Just go to Options and look under Text Editor > XML > Formatting Section Attributes
This option is particularly helpful for SharePoint XML and XSLT code.
Tags in SharePoint often have 50+ attributes!
Remove Workflow Status Columns
Working in SharePoint 2010, I used the Content and Structure Tool to copy list items from a list with workflows to one without
Unfortunately, the workflow status column was also created in the destination list.
Clearly, this wasn't a useful column and I didn't want it in my fields.
How do you remove a workflow status column?
It's pretty easy with some PowerShell
PS C:\> $web = Get-SPWeb https://site.domain.com/web
PS C:\> $list = $web.Lists["List Name"]
PS C:\> $field = $list.Fields["Workflow Status Column Name"]
PS C:\> $field.Hidden
False
PS C:\> $field.ReadOnlyField
True
PS C:\> $field.ReadOnlyField = $false
PS C:\> $field.Update()
Once the field is no longer a ReadOnlyField
you can delete it like any other column
You can also throw in $field.Delete()
at the end
Set-SCAdvisorActionAccount : The action parameter should be provided if computers are specified.
When configuring the SharePoint action account for System Center Advisor I ran into a problem.
http://onlinehelp.microsoft.com/en-us/advisor/hh923060.aspx
Run the Set-SCAdvisorActionAccount cmdlet to set the credentials. For example, if the agent computer name is Com1, run the following:
Set-SCAdvisorActionAccount -ActionAccountName Microsoft.SharePoint.Foundation.2010.AdminAccount -Credential $credential -AllowedComputer Com1
Well, that gives an error:
Set-SCAdvisorActionAccount : The action parameter should be provided if computers are specified.
Here is what it should look like:
Set-SCAdvisorActionAccount -ActionAccountName Microsoft.SharePoint.Foundation.2010.AdminAccount -Credential $credential -AllowedComputer Com1 -Action Set
Action parameter is explained on this other page:
http://onlinehelp.microsoft.com/en-us/advisor/hh965410.aspx
Parameters
-Action
Specifies an action. You have the following choices:
Set: Assign the computers in the -AllowedComputer parameter to the action account.
Add: Add the computers in the -AllowedComputer parameter to the action account.
Remove: Remove the computers listed in the -AllowedComputer parameter from the action account and delete the credentials stored in the computer*.
Clear: Remove all computers from the action account and delete the credential stored in all computers assigned to the action account*.
* After you remove a computer from the credential distribution from the gateway, the agent needs to wait for the next polling cycle to update the credentials. The agent compares the new and old credential sets and removes any credentials that are present in the old credential set but absent in the new set.
Here are the Cmdlets for System Center Advisor:
http://onlinehelp.microsoft.com/en-us/advisor/hh781477.aspx
Set Network Access Permission with PowerShell natively!
On the Active Directory Dial-in tab there is a section titled Network Access Permission which many VPN systems use to control access on a per-account basis.
You can set the value of this property using native PowerShell commands!
Get-ADUser -Filter {samaccountname -eq "AccountNameHere"} -SearchBase "OU=Some OU, DC=domain, DC=local" | Set-ADUser -Clear msNPAllowDialIn
Get-ADUser -Filter {samaccountname -eq "AccountNameHere"} -SearchBase "OU=Some OU, DC=domain, DC=local" | Set-ADUser -Add @{msNPAllowDialIn=$FALSE}
Cannot complete the configuration of the vSphere HA agent on the host. Misconfiguration in the host setup.
Today when adding a host to a cluster in vCenter I received this nearly useless error
Reconfigure vSphere HA host [host] Cannot complete the configuration of the vSphere HA agent on the host. Misconfiguration in the host setup.
vCenter Server hasn't been told the SHA1 SSL thumbprint is verified to be trusted.
Here are the steps to correct the problem
- In vSphere Client go to the Administration menu and select "vCenter Server Settings..."
- Click the "SSL Settings" tab on the left side
- Place a check mark in the "Verified" box for all your hosts you wish to configure for HA