Tag Archives: PowerShell

Top 10 Tips for Using PowerShell ISE

PowerShell logo

Microsoft’s ISE is free and is more or less the de facto Microsoft PowerShell development tool

If you’re just getting started with PowerShell, chances are you’ll be doing your work in the Integrated Scripting Environment (ISE). Although there are many third-party products that improve upon the features of ISE, Microsoft’s ISE is free and is more or less the de facto Microsoft PowerShell development tool. Sure, you can edit your PowerShell scripts in just about any text editor, including the venerable Notepad, but ISE is a much more productive tool, providing you with the ability to use IntelliSense and color-coded syntax as well as editing, executing, and debugging PowerShell scripts. In this column, I’ll show you 10 tips to make your PowerShell development in ISE more productive.

1. Put ISE on the Windows 8 Start Screen—Although PowerShell 3.0 and PowerShell ISE are both delivered out-of-the-box on Windows 8, there’s no PowerShell ISE option on the Windows 8 Start Screen or desktop, and if you search through Apps you won’t find it. That doesn’t mean that PowerShell ISE isn’t there. It’s hidden on the Administrative menu, which isn’t displayed by default. To add the Administrative menu and the PowerShell ISE option to the Windows 8 Start Screen, open the Windows 8 Settings charm, choose the Tiles option, then move the Show administrative tools slider to Yes.

2. Set the Execution Policy—Oddly, although ISE is clearly oriented toward developing scripts, it does nothing to change PowerShell’s default script execution policy, which doesn’t allow scripts to run. The default PowerShell execution policy is set to Restricted. To allow ISE to run PowerShell scripts, go to the Console pane and enter the following command:

Set-ExecutionPolicy RemoteSigned

3. Open Multiple Tabs—One of the things that makes ISE so much more powerful than Notepad is that it lets you open multiple tabs and work on multiple scripts at the same time. Unlike Notepad, it doesn’t isolate you in a single window. You can approximate this functionality with multiple Notepad windows, but then you lose out on the color coding, IntelliSense, and code snippets. To open multiple tabs, use the File, New option or the File, Open option, and ISE will open a new tab in the Scripting pane.

4. Use Snippets—If you’re not a developer, you might not know what code snippets are all about. Code snippets are prebuilt code blocks that you can insert into the Scripting pane to give you a head start in writing the correct PowerShell code. For example, if you want to use an If-Else statement but you don’t remember the exact syntax, you can simply position your curser where you want the If-Else statement to start and then press Ctrl+J or select Start Snippets from ISE’s Edit menu. Doing so will display a dialog box with all the available snippets. As you scroll through the dialog box, a tooltip displays the actual PowerShell code that will be inserted.

5. Use Code Regions—Another feature that ISE provides to help you navigate your code is regions. Regions are collapsible sections of code indicated by a minus sign and an outline marker on the left side of the Script pane. ISE automatically creates regions for block structures, such as If-Else, For-Next, For-Each, and While loops. You can also create your own regions by marking the start of the region using the #region tag, optionally followed by a name. You mark the end of the region by using the #endregion tag. A closely related feature is PowerShell’s automatic brace matching. If you select a brace or parenthesis, ISE will automatically highlight the matching brace or parenthesis.

6. Use F1 PowerShell Help—As you might expect, ISE provides a lot of help for people who are just getting started with PowerShell. The Command Add-In pane on the right side of the screen can help you see the valid parameters for the various PowerShell cmdlets. The built-in F1 Help goes further by displaying a graphical pop-up window displaying Help for a selected PowerShell cmdlet. You can take advantage of the pop-up F1 Help by simply moving your cursor over a cmdlet that you want to display Help for and pressing F1.

7. Run Code—Although it might not be as full featured as some of the third-party PowerShell development products, ISE is completely capable of running and debugging PowerShell code. To run just part of a script, highlight the text you want to run and click the Run Script icon or press F5. Doing so will run just the selected code. To run the entire script, click the Run Script icon or press F5 without making a specific code selection. You’ll see the results of the PowerShell code displayed in the Console pane.

8. Set Breakpoints—For a serious script developer, one of the most important features in ISE is its integrated debugger. You can use breakpoints to stop the execution of a given PowerShell script on a specific line. Breakpoints can be set on lines or variables. To toggle a breakpoint on a line, right-click on the line where you want the code execution to stop, then select Toggle Breakpoint from the context menu. Alternatively, you can click on the line and select Toggle Breakpoint form the Debug menu. You can also use the PowerShellset-psbreakpoint and get-psbreakpoint cmdlets to set and view breakpoints. You can’t set breakpoints on comment lines.

9. Single Step with the Debugger—Just as important as setting breakpoints is the ability to track the execution of your code by single stepping through the code. Single stepping though your code can help uncover logic problems that the code might have. The easiest way to single step is to press the F10 key after the code has halted on a breakpoint. You can also select Step Over from the Debug menu. If you have looping structures or functions that you want to step through, you can use F11 or Step Into from the Debug menu. Shift+F11 or Step Out will quickly exit the loop or function.

10. Examine Variables—Although stepping through your code is a valuable tool for uncovering logic errors, the ability to display the contents of variables is just as important. To display the contents of a variable, simply hover the mouse over any occurrence of the variable in the Script pane. You can also go to the Console pane and type in the variable name and press Enter. Of course, the execution of the script needs to be paused when you display a variable.

Ref : Windowsitpro

Advertisements

List All SharePoint 2013 PowerShell Commands

PowerShell logoSharePoint-2013The preview has been released and with it comes many new features and capabilities. Microsoft continues to invest in PowerShell, as noted through their recent previews of Windows 8 and Windows Server 2012. SharePoint 2013 makes no exception. The preview includes 772 commands!

Get Count
(Get-Command -PSSnapin Microsoft.SharePoint.PowerShell).count

List All Commands
Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” | select name, definition | fl > C:\SP2013_PowerShell_Commands.txt

Full List
Here are all the commands in the preview. I will highlight some of these individually over the coming weeks.

Add-SPAppDeniedEndpoint
Add-SPClaimTypeMapping
Add-SPDiagnosticsPerformanceCounter
Add-SPDistributedCacheServiceInstanceOnLocalServer
Add-SPEduClassMember
Add-SPEduUser
Add-SPInfoPathUserAgent
Add-SPPluggableSecurityTrimmer
Add-SPProfileLeader
Add-SPProfileSyncConnection
Add-SPRoutingMachineInfo
Add-SPRoutingMachinePool
Add-SPRoutingRule
Add-SPScaleOutDatabase
Add-SPServerScaleOutDatabase
Add-SPServiceApplicationProxyGroupMember
Add-SPShellAdmin
Add-SPSiteSubscriptionFeaturePackMember
Add-SPSiteSubscriptionProfileConfig
Add-SPSocialAppPermissions
Add-SPSolution
Add-SPThrottlingRule
Add-SPUserLicenseMapping
Add-SPUserSolution
Backup-SPConfigurationDatabase                                                
Backup-SPEnterpriseSearchServiceApplicationIndex                              
Backup-SPFarm                                                                 
Backup-SPSite                                                                 
Clear-SPAppDeniedEndpoints
Clear-SPBusinessDataCatalogEntityNotificationWeb
Clear-SPDistributedCacheItem
Clear-SPLogLevel
Clear-SPMetadataWebServicePartitionData
Clear-SPPerformancePointServiceApplicationTrustedLocation
Clear-SPScaleOutDatabaseDeletedDataSubRange
Clear-SPScaleOutDatabaseLog
Clear-SPScaleOutDatabaseTenantData
Clear-SPSecureStoreCredentialMapping
Clear-SPSecureStoreDefaultProvider
Clear-SPServerScaleOutDatabaseDeletedDataSubRange
Clear-SPServerScaleOutDatabaseLog
Clear-SPServerScaleOutDatabaseTenantData
Clear-SPSiteSubscriptionBusinessDataCatalogConfig
Connect-SPConfigurationDatabase
Convert-SPWebApplication
Copy-LocalActivitiesToWorkflowService
Copy-SPAccessServicesDatabase
Copy-SPBusinessDataCatalogAclToChildren
Copy-SPSite
Disable-SPAppAutoProvision
Disable-SPBusinessDataCatalogEntity
Disable-SPFeature
Disable-SPHealthAnalysisRule
Disable-SPInfoPathFormTemplate
Disable-SPSessionStateService
Disable-SPSingleSignOn
Disable-SPTimerJob
Disable-SPUserLicensing
Disable-SPWebApplicationHttpThrottling
Disconnect-SPConfigurationDatabase
Dismount-SPContentDatabase                                                    
Dismount-SPStateServiceDatabase                                               
Enable-SPAppAutoProvision
Enable-SPBusinessDataCatalogEntity
Enable-SPFeature
Enable-SPHealthAnalysisRule
Enable-SPInfoPathFormTemplate
Enable-SPSessionStateService
Enable-SPTimerJob
Enable-SPUserLicensing
Enable-SPWebApplicationHttpThrottling
Export-SPAppPackage
Export-SPBusinessDataCatalogModel
Export-SPEnterpriseSearchTopology
Export-SPInfoPathAdministrationFiles
Export-SPMetadataWebServicePartitionData
Export-SPPerformancePointContent
Export-SPScaleOutDatabaseTenantData
Export-SPServerScaleOutDatabaseTenantData
Export-SPSiteSubscriptionBusinessDataCatalogConfig
Export-SPSiteSubscriptionSettings
Export-SPWeb
Get-SPAccessServiceApplication
Get-SPAccessServicesApplication
Get-SPAccessServicesDatabase
Get-SPAccessServicesDatabaseServer
Get-SPAccessServicesDatabaseServerGroup
Get-SPAccessServicesDatabaseServerGroupMapping
Get-SPAlternateURL
Get-SPAppAcquisitionSettings
Get-SPAppAutoProvisionConnection
Get-SPAppDeniedEndpoints
Get-SPAppDisableSettings
Get-SPAppDomain
Get-SPAppHostingQuotas
Get-SPAppInstance
Get-SPAppMarketplaceSettings
Get-SPAppPrincipal
Get-SPAppScaleProfile
Get-SPAppSiteSubscriptionName
Get-SPAppStateSyncLastRunTime
Get-SPAppStateUpdateInterval
Get-SPAuthenticationProvider
Get-SPAuthenticationRealm
Get-SPBackupHistory
Get-SPBingMapsBlockInAllLocales
Get-SPBingMapsKey
Get-SPBrowserCustomerExperienceImprovementProgram
Get-SPBusinessDataCatalogEntityNotificationWeb
Get-SPBusinessDataCatalogMetadataObject
Get-SPBusinessDataCatalogThrottleConfig
Get-SPCertificateAuthority
Get-SPClaimProvider
Get-SPClaimProviderManager
Get-SPClaimTypeEncoding
Get-SPContentDatabase
Get-SPContentDeploymentJob
Get-SPContentDeploymentPath
Get-SPCustomLayoutsPage
Get-SPDatabase
Get-SPDataConnectionFile
Get-SPDataConnectionFileDependent
Get-SPDeletedSite
Get-SPDesignerSettings
Get-SPDiagnosticConfig
Get-SPDiagnosticsPerformanceCounter
Get-SPDiagnosticsProvider
Get-SPDistributedCacheClientSetting
Get-SPEduServiceSetting
Get-SPEnterpriseSearchAdministrationComponent
Get-SPEnterpriseSearchComponent
Get-SPEnterpriseSearchContentEnrichmentConfiguration
Get-SPEnterpriseSearchCrawlContentSource
Get-SPEnterpriseSearchCrawlCustomConnector
Get-SPEnterpriseSearchCrawlDatabase
Get-SPEnterpriseSearchCrawlExtension
Get-SPEnterpriseSearchCrawlLogReadPermission
Get-SPEnterpriseSearchCrawlMapping
Get-SPEnterpriseSearchCrawlRule
Get-SPEnterpriseSearchFileFormat
Get-SPEnterpriseSearchHostController
Get-SPEnterpriseSearchLanguageResourcePhrase
Get-SPEnterpriseSearchLinguisticComponentsStatus
Get-SPEnterpriseSearchLinksDatabase
Get-SPEnterpriseSearchMetadataCategory
Get-SPEnterpriseSearchMetadataCrawledProperty
Get-SPEnterpriseSearchMetadataManagedProperty
Get-SPEnterpriseSearchMetadataMapping
Get-SPEnterpriseSearchOwner
Get-SPEnterpriseSearchPropertyRule
Get-SPEnterpriseSearchPropertyRuleCollection
Get-SPEnterpriseSearchQueryAndSiteSettingsService
Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance
Get-SPEnterpriseSearchQueryAndSiteSettingsServiceProxy
Get-SPEnterpriseSearchQueryAuthority
Get-SPEnterpriseSearchQueryDemoted
Get-SPEnterpriseSearchQueryKeyword
Get-SPEnterpriseSearchQueryScope
Get-SPEnterpriseSearchQueryScopeRule
Get-SPEnterpriseSearchQuerySpellingCorrection
Get-SPEnterpriseSearchQuerySuggestionCandidates
Get-SPEnterpriseSearchRankingModel
Get-SPEnterpriseSearchResultItemType
Get-SPEnterpriseSearchSecurityTrimmer
Get-SPEnterpriseSearchService
Get-SPEnterpriseSearchServiceApplication
Get-SPEnterpriseSearchServiceApplicationBackupStore
Get-SPEnterpriseSearchServiceApplicationProxy
Get-SPEnterpriseSearchServiceInstance
Get-SPEnterpriseSearchSiteHitRule
Get-SPEnterpriseSearchStatus
Get-SPEnterpriseSearchTopology
Get-SPEnterpriseSearchVssDataPath
Get-SPExcelBIServer
Get-SPExcelBlockedFileType
Get-SPExcelDataConnectionLibrary
Get-SPExcelDataProvider
Get-SPExcelFileLocation
Get-SPExcelServiceApplication
Get-SPExcelUserDefinedFunction
Get-SPFarm
Get-SPFarmConfig
Get-SPFeature
Get-SPHealthAnalysisRule
Get-SPHelpCollection
Get-SPInfoPathFormsService
Get-SPInfoPathFormTemplate
Get-SPInfoPathUserAgent
Get-SPInfoPathWebServiceProxy
Get-SPInternalAppStateSyncLastRunTime
Get-SPInternalAppStateUpdateInterval
Get-SPIRMSettings
Get-SPLogEvent
Get-SPLogLevel
Get-SPManagedAccount
Get-SPManagedPath
Get-SPMetadataServiceApplication
Get-SPMetadataServiceApplicationProxy
Get-SPMobileMessagingAccount
Get-SPODataConnectionSetting
Get-SPODataConnectionSettingMetadata
Get-SPOfficeStoreAppsDefaultActivation
Get-SPPendingUpgradeActions
Get-SPPerformancePointServiceApplication
Get-SPPerformancePointServiceApplicationTrustedLocation
Get-SPPluggableSecurityTrimmer
Get-SPProcessAccount
Get-SPProduct
Get-SPProfileLeader
Get-SPProfileServiceApplicationSecurity
Get-SPRequestManagementSettings
Get-SPRoutingMachineInfo
Get-SPRoutingMachinePool
Get-SPRoutingRule
Get-SPScaleOutDatabase
Get-SPScaleOutDatabaseDataState
Get-SPScaleOutDatabaseInconsistency
Get-SPScaleOutDatabaseLogEntry
Get-SPSecureStoreApplication
Get-SPSecureStoreSystemAccounts
Get-SPSecurityTokenServiceConfig
Get-SPServer
Get-SPServerScaleOutDatabase
Get-SPServerScaleOutDatabaseDataState
Get-SPServerScaleOutDatabaseInconsistency
Get-SPServerScaleOutDatabaseLogEntry
Get-SPServiceApplication
Get-SPServiceApplicationEndpoint
Get-SPServiceApplicationPool
Get-SPServiceApplicationProxy
Get-SPServiceApplicationProxyGroup
Get-SPServiceApplicationSecurity
Get-SPServiceContext
Get-SPServiceHostConfig
Get-SPServiceInstance
Get-SPSessionStateService
Get-SPShellAdmin
Get-SPSite
Get-SPSiteAdministration
Get-SPSiteSubscription
Get-SPSiteSubscriptionConfig
Get-SPSiteSubscriptionEdiscoveryHub
Get-SPSiteSubscriptionEdiscoverySearchScope
Get-SPSiteSubscriptionFeaturePack
Get-SPSiteSubscriptionIRMConfig
Get-SPSiteSubscriptionMetadataConfig
Get-SPSiteUpgradeSessionInfo
Get-SPSiteURL
Get-SPSolution
Get-SPStateServiceApplication
Get-SPStateServiceApplicationProxy
Get-SPStateServiceDatabase
Get-SPTaxonomySession
Get-SPThrottlingRule
Get-SPTimerJob
Get-SPTopologyServiceApplication
Get-SPTopologyServiceApplicationProxy
Get-SPTrustedIdentityTokenIssuer
Get-SPTrustedRootAuthority
Get-SPTrustedSecurityTokenIssuer
Get-SPTrustedSecurityTokenService
Get-SPTrustedServiceTokenIssuer
Get-SPUpgradeActions
Get-SPUsageApplication
Get-SPUsageDefinition
Get-SPUsageService
Get-SPUser
Get-SPUserLicense
Get-SPUserLicenseMapping
Get-SPUserLicensing
Get-SPUserSettingsProvider
Get-SPUserSettingsProviderManager
Get-SPUserSolution
Get-SPVisioExternalData
Get-SPVisioPerformance
Get-SPVisioSafeDataProvider
Get-SPVisioServiceApplication
Get-SPVisioServiceApplicationProxy
Get-SPWeb
Get-SPWebApplication
Get-SPWebApplicationHttpThrottlingMonitor
Get-SPWebPartPack
Get-SPWebTemplate
Get-SPWOPIBinding
Get-SPWOPISuppressionSetting
Get-SPWOPIZone
Get-SPWorkflowConfig
Get-TranslationThrottlingSettings
Get-WorkflowServiceApplicationProxy
Grant-SPBusinessDataCatalogMetadataObject                                     
Grant-SPObjectSecurity                                                        
Import-SPAppPackage
Import-SPBusinessDataCatalogDotNetAssembly
Import-SPBusinessDataCatalogModel
Import-SPEnterpriseSearchCustomExtractionDictionary
Import-SPEnterpriseSearchPopularQueries
Import-SPEnterpriseSearchThesaurus
Import-SPEnterpriseSearchTopology
Import-SPInfoPathAdministrationFiles
Import-SPMetadataWebServicePartitionData
Import-SPPerformancePointContent
Import-SPScaleOutDatabaseTenantData
Import-SPServerScaleOutDatabaseTenantData
Import-SPSiteSubscriptionBusinessDataCatalogConfig
Import-SPSiteSubscriptionSettings
Import-SPWeb
Initialize-SPResourceSecurity                                                 
Initialize-SPStateServiceDatabase                                             
Install-SPApp                                                                 
Install-SPApplicationContent                                                  
Install-SPDataConnectionFile                                                  
Install-SPEduSites                                                            
Install-SPFeature                                                             
Install-SPHelpCollection                                                      
Install-SPInfoPathFormTemplate                                                
Install-SPService                                                             
Install-SPSolution                                                            
Install-SPUserSolution                                                        
Install-SPWebPartPack                                                         
Merge-SPLogFile                                                               
Mount-SPContentDatabase                                                       
Mount-SPStateServiceDatabase                                                  
Move-SPBlobStorageLocation
Move-SPDeletedSite
Move-SPProfileManagedMetadataProperty
Move-SPSite
Move-SPSocialComments
Move-SPUser
New-SPAccessServiceApplication
New-SPAccessServicesApplication
New-SPAccessServicesApplicationProxy
New-SPAccessServicesDatabaseServer
New-SPAlternateURL
New-SPAppManagementServiceApplication
New-SPAppManagementServiceApplicationProxy
New-SPAuthenticationProvider
New-SPAzureAccessControlServiceApplicationProxy
New-SPBECWebServiceApplicationProxy
New-SPBusinessDataCatalogServiceApplication
New-SPBusinessDataCatalogServiceApplicationProxy
New-SPCentralAdministration
New-SPClaimProvider
New-SPClaimsPrincipal
New-SPClaimTypeEncoding
New-SPClaimTypeMapping
New-SPConfigurationDatabase
New-SPContentDatabase
New-SPContentDeploymentJob
New-SPContentDeploymentPath
New-SPEduClass
New-SPEnterpriseSearchAdminComponent
New-SPEnterpriseSearchAnalyticsProcessingComponent
New-SPEnterpriseSearchContentEnrichmentConfiguration
New-SPEnterpriseSearchContentProcessingComponent
New-SPEnterpriseSearchCrawlComponent
New-SPEnterpriseSearchCrawlContentSource
New-SPEnterpriseSearchCrawlCustomConnector
New-SPEnterpriseSearchCrawlDatabase
New-SPEnterpriseSearchCrawlExtension
New-SPEnterpriseSearchCrawlMapping
New-SPEnterpriseSearchCrawlRule
New-SPEnterpriseSearchFileFormat
New-SPEnterpriseSearchIndexComponent
New-SPEnterpriseSearchLanguageResourcePhrase
New-SPEnterpriseSearchLinksDatabase
New-SPEnterpriseSearchMetadataCategory
New-SPEnterpriseSearchMetadataCrawledProperty
New-SPEnterpriseSearchMetadataManagedProperty
New-SPEnterpriseSearchMetadataMapping
New-SPEnterpriseSearchQueryAuthority
New-SPEnterpriseSearchQueryDemoted
New-SPEnterpriseSearchQueryKeyword
New-SPEnterpriseSearchQueryProcessingComponent
New-SPEnterpriseSearchQueryScope
New-SPEnterpriseSearchQueryScopeRule
New-SPEnterpriseSearchRankingModel
New-SPEnterpriseSearchResultItemType
New-SPEnterpriseSearchSecurityTrimmer
New-SPEnterpriseSearchServiceApplication
New-SPEnterpriseSearchServiceApplicationProxy
New-SPEnterpriseSearchSiteHitRule
New-SPEnterpriseSearchTopology
New-SPExcelBIServer
New-SPExcelBlockedFileType
New-SPExcelDataConnectionLibrary
New-SPExcelDataProvider
New-SPExcelFileLocation
New-SPExcelServiceApplication
New-SPExcelUserDefinedFunction
New-SPLogFile
New-SPManagedAccount
New-SPManagedPath
New-SPMarketplaceWebServiceApplicationProxy
New-SPMetadataServiceApplication
New-SPMetadataServiceApplicationProxy
New-SPODataConnectionSetting
New-SPPerformancePointServiceApplication
New-SPPerformancePointServiceApplicationProxy
New-SPPerformancePointServiceApplicationTrustedLocation
New-SPPowerPointConversionServiceApplication
New-SPPowerPointConversionServiceApplicationProxy
New-SPProfileServiceApplication
New-SPProfileServiceApplicationProxy
New-SPRequestManagementRuleCriteria
New-SPSecureStoreApplication
New-SPSecureStoreApplicationField
New-SPSecureStoreServiceApplication
New-SPSecureStoreServiceApplicationProxy
New-SPSecureStoreTargetApplication
New-SPServiceApplicationPool
New-SPServiceApplicationProxyGroup
New-SPSite
New-SPSiteSubscription
New-SPSiteSubscriptionFeaturePack
New-SPStateServiceApplication
New-SPStateServiceApplicationProxy
New-SPStateServiceDatabase
New-SPSubscriptionSettingsServiceApplication
New-SPSubscriptionSettingsServiceApplicationProxy
New-SPTranslationServiceApplication
New-SPTranslationServiceApplicationProxy
New-SPTrustedIdentityTokenIssuer
New-SPTrustedRootAuthority
New-SPTrustedSecurityTokenIssuer
New-SPTrustedSecurityTokenService
New-SPTrustedServiceTokenIssuer
New-SPUsageApplication
New-SPUsageLogFile
New-SPUser
New-SPUserLicenseMapping
New-SPUserSettingsProvider
New-SPVisioSafeDataProvider
New-SPVisioServiceApplication
New-SPVisioServiceApplicationProxy
New-SPWeb
New-SPWebApplication
New-SPWebApplicationExtension
New-SPWOPIBinding
New-SPWOPISuppressionSetting
New-SPWordConversionServiceApplication
New-SPWorkManagementServiceApplication
New-SPWorkManagementServiceApplicationProxy
New-WorkflowServiceApplicationProxy
Publish-SPServiceApplication                                                  
Receive-SPServiceApplicationConnectionInfo
Register-SPAppPrincipal
Register-SPWorkflowService
Remove-SPAccessServicesDatabaseServer
Remove-SPActivityFeedItems
Remove-SPAlternateURL
Remove-SPAppDeniedEndpoint
Remove-SPAppPrincipalPermission
Remove-SPBusinessDataCatalogModel
Remove-SPClaimProvider
Remove-SPClaimTypeMapping
Remove-SPConfigurationDatabase
Remove-SPContentDatabase
Remove-SPContentDeploymentJob
Remove-SPContentDeploymentPath
Remove-SPDeletedSite
Remove-SPDiagnosticsPerformanceCounter
Remove-SPDistributedCacheServiceInstanceOnLocalServer
Remove-SPEduClassMember
Remove-SPEnterpriseSearchComponent
Remove-SPEnterpriseSearchContentEnrichmentConfiguration
Remove-SPEnterpriseSearchCrawlContentSource
Remove-SPEnterpriseSearchCrawlCustomConnector
Remove-SPEnterpriseSearchCrawlDatabase
Remove-SPEnterpriseSearchCrawlExtension
Remove-SPEnterpriseSearchCrawlLogReadPermission
Remove-SPEnterpriseSearchCrawlMapping
Remove-SPEnterpriseSearchCrawlRule
Remove-SPEnterpriseSearchFileFormat
Remove-SPEnterpriseSearchLanguageResourcePhrase
Remove-SPEnterpriseSearchLinksDatabase
Remove-SPEnterpriseSearchMetadataCategory
Remove-SPEnterpriseSearchMetadataManagedProperty
Remove-SPEnterpriseSearchMetadataMapping
Remove-SPEnterpriseSearchQueryAuthority
Remove-SPEnterpriseSearchQueryDemoted
Remove-SPEnterpriseSearchQueryKeyword
Remove-SPEnterpriseSearchQueryScope
Remove-SPEnterpriseSearchQueryScopeRule
Remove-SPEnterpriseSearchRankingModel
Remove-SPEnterpriseSearchResultItemType
Remove-SPEnterpriseSearchSecurityTrimmer
Remove-SPEnterpriseSearchServiceApplication
Remove-SPEnterpriseSearchServiceApplicationProxy
Remove-SPEnterpriseSearchServiceApplicationSiteSettings
Remove-SPEnterpriseSearchSiteHitRule
Remove-SPEnterpriseSearchTenantConfiguration
Remove-SPEnterpriseSearchTenantSchema
Remove-SPEnterpriseSearchTopology
Remove-SPExcelBIServer
Remove-SPExcelBlockedFileType
Remove-SPExcelDataConnectionLibrary
Remove-SPExcelDataProvider
Remove-SPExcelFileLocation
Remove-SPExcelUserDefinedFunction
Remove-SPInfoPathUserAgent
Remove-SPManagedAccount
Remove-SPManagedPath
Remove-SPODataConnectionSetting
Remove-SPPerformancePointServiceApplication
Remove-SPPerformancePointServiceApplicationProxy
Remove-SPPerformancePointServiceApplicationTrustedLocation
Remove-SPPluggableSecurityTrimmer
Remove-SPProfileLeader
Remove-SPProfileSyncConnection
Remove-SPRoutingMachineInfo
Remove-SPRoutingMachinePool
Remove-SPRoutingRule
Remove-SPScaleOutDatabase
Remove-SPSecureStoreApplication
Remove-SPServerScaleOutDatabase
Remove-SPServiceApplication
Remove-SPServiceApplicationPool
Remove-SPServiceApplicationProxy
Remove-SPServiceApplicationProxyGroup
Remove-SPServiceApplicationProxyGroupMember
Remove-SPShellAdmin
Remove-SPSite
Remove-SPSiteSubscription
Remove-SPSiteSubscriptionBusinessDataCatalogConfig
Remove-SPSiteSubscriptionFeaturePack
Remove-SPSiteSubscriptionFeaturePackMember
Remove-SPSiteSubscriptionMetadataConfig
Remove-SPSiteSubscriptionProfileConfig
Remove-SPSiteSubscriptionSettings
Remove-SPSiteUpgradeSessionInfo
Remove-SPSiteURL
Remove-SPSocialAppPermissions
Remove-SPSocialItemByDate
Remove-SPSolution
Remove-SPSolutionDeploymentLock
Remove-SPStateServiceDatabase
Remove-SPThrottlingRule
Remove-SPTranslationServiceJobHistory
Remove-SPTrustedIdentityTokenIssuer
Remove-SPTrustedRootAuthority
Remove-SPTrustedSecurityTokenIssuer
Remove-SPTrustedSecurityTokenService
Remove-SPTrustedServiceTokenIssuer
Remove-SPUsageApplication
Remove-SPUser
Remove-SPUserLicenseMapping
Remove-SPUserSettingsProvider
Remove-SPUserSolution
Remove-SPVisioSafeDataProvider
Remove-SPWeb
Remove-SPWebApplication
Remove-SPWOPIBinding
Remove-SPWOPISuppressionSetting
Remove-SPWordConversionServiceJobHistory
Rename-SPServer
Repair-SPManagedAccountDeployment                                             
Repair-SPSite                                                                 
Repartition-SPEnterpriseSearchLinksDatabases                                  
Request-SPUpgradeEvaluationSite                                               
Reset-SPAccessServicesDatabasePassword
Restart-SPAppInstanceJobs
Restore-SPDeletedSite
Restore-SPEnterpriseSearchServiceApplication
Restore-SPEnterpriseSearchServiceApplicationIndex
Restore-SPFarm
Restore-SPSite
Resume-SPEnterpriseSearchServiceApplication
Resume-SPStateServiceDatabase
Revoke-SPBusinessDataCatalogMetadataObject                                    
Revoke-SPObjectSecurity                                                       
Set-SPAccessServiceApplication
Set-SPAccessServicesApplication
Set-SPAccessServicesDatabaseServer
Set-SPAccessServicesDatabaseServerGroupMapping
Set-SPAlternateURL
Set-SPAppAcquisitionSettings
Set-SPAppAutoProvisionConnection
Set-SPAppDisableSettings
Set-SPAppDomain
Set-SPAppHostingQuotas
Set-SPAppManagementDeploymentId
Set-SPAppMarketplaceSettings
Set-SPAppPrincipalPermission
Set-SPAppScaleProfile
Set-SPAppSiteSubscriptionName
Set-SPAppStateUpdateInterval
Set-SPAuthenticationRealm
Set-SPBingMapsBlockInAllLocales
Set-SPBingMapsKey
Set-SPBrowserCustomerExperienceImprovementProgram
Set-SPBusinessDataCatalogEntityNotificationWeb
Set-SPBusinessDataCatalogMetadataObject
Set-SPBusinessDataCatalogServiceApplication
Set-SPBusinessDataCatalogThrottleConfig
Set-SPCentralAdministration
Set-SPClaimProvider
Set-SPContentDatabase
Set-SPContentDeploymentJob
Set-SPContentDeploymentPath
Set-SPCustomLayoutsPage
Set-SPDataConnectionFile
Set-SPDesignerSettings
Set-SPDiagnosticConfig
Set-SPDiagnosticsProvider
Set-SPDistributedCacheClientSetting
Set-SPEduServiceSetting
Set-SPEnterpriseSearchAdministrationComponent
Set-SPEnterpriseSearchContentEnrichmentConfiguration
Set-SPEnterpriseSearchCrawlContentSource
Set-SPEnterpriseSearchCrawlDatabase
Set-SPEnterpriseSearchCrawlLogReadPermission
Set-SPEnterpriseSearchCrawlRule
Set-SPEnterpriseSearchLinguisticComponentsStatus
Set-SPEnterpriseSearchLinksDatabase
Set-SPEnterpriseSearchMetadataCategory
Set-SPEnterpriseSearchMetadataCrawledProperty
Set-SPEnterpriseSearchMetadataManagedProperty
Set-SPEnterpriseSearchMetadataMapping
Set-SPEnterpriseSearchPrimaryHostController
Set-SPEnterpriseSearchQueryAuthority
Set-SPEnterpriseSearchQueryKeyword
Set-SPEnterpriseSearchQueryScope
Set-SPEnterpriseSearchQueryScopeRule
Set-SPEnterpriseSearchQuerySpellingCorrection
Set-SPEnterpriseSearchRankingModel
Set-SPEnterpriseSearchResultItemType
Set-SPEnterpriseSearchService
Set-SPEnterpriseSearchServiceApplication
Set-SPEnterpriseSearchServiceApplicationProxy
Set-SPEnterpriseSearchServiceInstance
Set-SPEnterpriseSearchTopology
Set-SPExcelBIServer
Set-SPExcelDataConnectionLibrary
Set-SPExcelDataProvider
Set-SPExcelFileLocation
Set-SPExcelServiceApplication
Set-SPExcelUserDefinedFunction
Set-SPFarmConfig
Set-SPInfoPathFormsService
Set-SPInfoPathFormTemplate
Set-SPInfoPathWebServiceProxy
Set-SPInternalAppStateUpdateInterval
Set-SPIRMSettings
Set-SPLogLevel
Set-SPManagedAccount
Set-SPMetadataServiceApplication
Set-SPMetadataServiceApplicationProxy
Set-SPMobileMessagingAccount
Set-SPODataConnectionSetting
Set-SPODataConnectionSettingMetadata
Set-SPOfficeStoreAppsDefaultActivation
Set-SPPassPhrase
Set-SPPerformancePointSecureDataValues
Set-SPPerformancePointServiceApplication
Set-SPPowerPointConversionServiceApplication
Set-SPProfileServiceApplication
Set-SPProfileServiceApplicationProxy
Set-SPProfileServiceApplicationSecurity
Set-SPRequestManagementSettings
Set-SPRoutingMachineInfo
Set-SPRoutingMachinePool
Set-SPRoutingRule
Set-SPScaleOutDatabaseDataRange
Set-SPScaleOutDatabaseDataSubRange
Set-SPSecureStoreApplication
Set-SPSecureStoreDefaultProvider
Set-SPSecureStoreServiceApplication
Set-SPSecureStoreSystemAccounts
Set-SPSecurityTokenServiceConfig
Set-SPServerScaleOutDatabaseDataRange
Set-SPServerScaleOutDatabaseDataSubRange
Set-SPServiceApplication
Set-SPServiceApplicationEndpoint
Set-SPServiceApplicationPool
Set-SPServiceApplicationSecurity
Set-SPServiceHostConfig
Set-SPSessionStateService
Set-SPSite
Set-SPSiteAdministration
Set-SPSiteSubscriptionConfig
Set-SPSiteSubscriptionEdiscoveryHub
Set-SPSiteSubscriptionIRMConfig
Set-SPSiteSubscriptionMetadataConfig
Set-SPSiteSubscriptionProfileConfig
Set-SPSiteURL
Set-SPStateServiceApplication
Set-SPStateServiceApplicationProxy
Set-SPStateServiceDatabase
Set-SPSubscriptionSettingsServiceApplication
Set-SPThrottlingRule
Set-SPTimerJob
Set-SPTopologyServiceApplication
Set-SPTopologyServiceApplicationProxy
Set-SPTranslationServiceApplication
Set-SPTranslationServiceApplicationProxy
Set-SPTrustedIdentityTokenIssuer
Set-SPTrustedRootAuthority
Set-SPTrustedSecurityTokenIssuer
Set-SPTrustedSecurityTokenService
Set-SPTrustedServiceTokenIssuer
Set-SPUsageApplication
Set-SPUsageDefinition
Set-SPUsageService
Set-SPUser
Set-SPVisioExternalData
Set-SPVisioPerformance
Set-SPVisioSafeDataProvider
Set-SPVisioServiceApplication
Set-SPWeb
Set-SPWebApplication
Set-SPWebApplicationHttpThrottlingMonitor
Set-SPWOPIBinding
Set-SPWOPIZone
Set-SPWordConversionServiceApplication
Set-SPWorkflowConfig
Set-SPWorkManagementServiceApplication
Set-SPWorkManagementServiceApplicationProxy
Set-TranslationThrottlingSettings
Split-SPScaleOutDatabase
Split-SPServerScaleOutDatabase
Start-SPAdminJob
Start-SPAssignment
Start-SPContentDeploymentJob
Start-SPDiagnosticsSession
Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance
Start-SPEnterpriseSearchServiceInstance
Start-SPInfoPathFormTemplate
Start-SPServiceInstance
Start-SPTimerJob
Stop-SPAssignment
Stop-SPDiagnosticsSession
Stop-SPDistributedCacheServiceInstanceGracefullyOnLocalServer
Stop-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance
Stop-SPEnterpriseSearchServiceInstance
Stop-SPInfoPathFormTemplate
Stop-SPServiceInstance
Suspend-SPEnterpriseSearchServiceApplication
Suspend-SPStateServiceDatabase
Test-SPContentDatabase
Test-SPInfoPathFormTemplate
Test-SPSite
Uninstall-SPAppInstance                                                       
Uninstall-SPDataConnectionFile                                                
Uninstall-SPFeature                                                           
Uninstall-SPHelpCollection                                                    
Uninstall-SPInfoPathFormTemplate                                              
Uninstall-SPSolution                                                          
Uninstall-SPUserSolution                                                      
Uninstall-SPWebPartPack                                                       
Unpublish-SPServiceApplication                                                
Update-SPAppCatalogSettings
Update-SPAppInstance
Update-SPFarmEncryptionKey
Update-SPInfoPathAdminFileUrl
Update-SPInfoPathFormTemplate
Update-SPInfoPathUserFileUrl
Update-SPProfilePhotoStore
Update-SPRepopulateMicroblogFeedCache
Update-SPRepopulateMicroblogLMTCache
Update-SPSecureStoreApplicationServerKey
Update-SPSecureStoreCredentialMapping
Update-SPSecureStoreGroupCredentialMapping
Update-SPSecureStoreMasterKey
Update-SPSolution
Update-SPUserSolution
Update-SPWOPIProofKey
Upgrade-SPContentDatabase                                                     
Upgrade-SPEnterpriseSearchServiceApplication                                  
Upgrade-SPEnterpriseSearchServiceApplicationSiteSettings                      
Upgrade-SPFarm                                                                
Upgrade-SPSingleSignOnDatabase                                                
Upgrade-SPSite

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

PowerShell logo

When you launch the SharePoint 2013 or 2010 Management Shell (in this case SharePoint 2013) :

Run SharePoint 2013 PowerShell Management

The following error occured : “The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered”

CMD for SharePoint 2013 PowerShell Management

So to solve this problem

Launch this cmdlet as administrator and type

Add-SPShellAdmin -UserName Domain\User

In Other Cases you need to run the configuration wizard again.

How to Identify the Version and Service Packs installed on a SharePoint 2013 Server

In many cases, we may not be bothered about the Version, Service Packs installed on our Server when we do the development. It is obvious that, when we get the requirement, immediately we will start analysis the requirement.

But recently there was a situation that one of our client wants to move on to the new Service Pack which released on this April. In that case, we may also have to analyze the impact of the new Service Pack. Before knowing that, I just wanted to know, what are the things installed on our Dev environment first. Then on top of it, what needs to be installed and what would be the impact after installation.

To answer all these questions, First we need to know what is the version installed on our Farm. Use the following command to get the Version of the product installed using PowerShell script.(Get-SPFarm).Products.

First Run ISE as below :

Run_ISE_as_Administrator

Then after selecting the Commands of “Add.PSSnapin” output of the above command will be something like,Get-SPFarm_Products

By seeing the GUID, we will be able to identify the Product. These GUIDs will not change. On all the environments, and all the machines, the GUIDs will remain same.

Here are all of the product GUIDs:

GUID : 35466B1A-B17B-4DFB-A703-F74E2A1F5F5E Product : Project Server 2013

GUID : BC7BAF08-4D97-462C-8411-341052402E71 Product : Project Server 2013 Preview

GUID : C5D855EE-F32B-4A1C-97A8-F0A28CE02F9C Product : SharePoint Server 2013

GUID : CBF97833-C73A-4BAF-9ED3-D47B3CFF51BE Product : SharePoint Server 2013 Preview

GUID : B7D84C2B-0754-49E4-B7BE-7EE321DCE0A9 Product : SharePoint Server 2013 Enterprise

GUID : 298A586A-E3C1-42F0-AFE0-4BCFDC2E7CD0 Product : SharePoint Server 2013 Enterprise Preview

GUID : D6B57A0D-AE69-4A3E-B031-1F993EE52EDC Product : Microsoft Office Web Apps Server 2013

GUID : 9FF54EBC-8C12-47D7-854F-3865D4BE8118 Product : SharePoint Foundation 2013

And to know about the Service Packs, there is no need of any PowerShell Commands. That we can directly go to the Central Administration and find.

Go to Central Administration.image1

Click on “Upgrade and Migration” on the Quick Links. image2

Click on “Check Product and Patch Installation Status”image3

This will tell us the current Patches Installation. By seeing the Version column we can identify. On the screen shot above shared, there is no SP installed.

Using PowerShell – Make a new site – SharePoint 2010

1. Launch PowerShell for SharePoint Administration

2. Get-help

3. Make a new site using PowerShell

4. Get a list of all the site collections that exist in the farm

How to run SP2010 Management Shell Script from a BAT file?

The steps to achieve this:

1.       Take the PowerShell script.

2.       Remove all the comments ( everything that starts with #).

3.       Put ; at the end of each line.

4.       Remove all line breaks.

5.       Supply the string you get as the -command parameter for powershell.exe

Reference:

PowerShell script in a .bat file

SharePoint 2010 prompts to save PDF documents when opening (Solution)

I have run into this issue myself. In my case I had the following scenario:

  • Initially, my web application had ‘Browser File Handling’ set to ‘Strict’ (which is the default when creating a web application)
  • Created a site collection, then a custom document library, and saved it as a template
  • Created a new document library using the template
  • Changed the web application ‘Browser File Handling’ to ‘Permissive’
  • Found that I still was prompted to save PDF files before opening in the document libraries created with my template. Document libraries created with the out-of-the-box templates worked as expected.

I am sure there are more scenarios where this issue would surface, perhaps saving a web as a template before changing ‘Browser File Handling’. Although I should do more testing for a complete list of scenarios, I needed to find out what was the cause. So I investigated.

Each Document Library in SharePoint 2010 actually has a property titled BrowserFileHandling that is set based on the BrowserFileHandling selection at the Web Application level. In the scenario I described above, I have found that the inheritance of this property does not always behave as you would expect.  Using PowerShell (you could also use the object model) you can take a look at the BrowserFileHandling property at the Document Library level as this is not exposed in the UI.

Here is some PowerShell to help and please note this is used in the SharePoint 2010 Management Shell

#Get Web

$web = Get-SPWeb “http://yourspweburl”

#Get Document Library

$docLib = $web.lists[“Your Document Library Title”]

#View all properties/methods of the Document Library and you’ll see that BrowserFileHandling is a property

$docLib | Get-Member

#See the current BrowserFileHandling setting for the Document Library

$docLib.BrowserFileHandling

#If you need to change it from Strict to Permissive

$docLib.BrowserFileHandling = “Permissive”

$docLib.Update()

Even if the template scenario that I describe isn’t your scenario you can certainly use the above PowerShell code to inspect, and if necessary, change the BrowserFileHandling property in a Document Library that is presenting the problem you describe.

Reference : Resources and Tools for IT Professionals | TechNet