{"id":586,"date":"2016-10-05T07:46:00","date_gmt":"2016-10-05T07:46:00","guid":{"rendered":"http:\/\/blog.softreeconsulting.com\/?p=586"},"modified":"2016-10-05T07:46:00","modified_gmt":"2016-10-05T07:46:00","slug":"sneak-peak-list-useful-powershell-command-prompts","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/","title":{"rendered":"A Sneak Peak into the List of useful PowerShell Command Prompts"},"content":{"rendered":"<p><a href=\"http:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2016\/10\/COMMANDS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-589\" src=\"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2016\/10\/COMMANDS.png\" alt=\"commands\" width=\"927\" height=\"580\" \/><\/a><\/p>\n<p>SharePoint is undoubtedly a piece of art and it can drive business organizations of all sizes. However, sometime it causes chaos for its administrators, which leads to frustration and would require a huge amount of time to undergo tedious coding. Before that disappoints you, we want to confirm that there are PowerShell commands that can make the process a walk in the park.<\/p>\n<p><strong>A Stipulation<\/strong><br \/>\n<em>Before you use PowerShell, let us warn you that it may cause excruciating migraine headaches and dizziness. Protracting exposure this beast can amplify genetic baldness, nearsightedness and nausea. It is advisable that you should at least refrain yourself from operating heavy machinery or driving a SUV.<\/em> Well\u2026that was a joke,,gotcha!!<\/p>\n<p><strong>But, do ensure you have backups before going further with PowerShell commands. <\/strong><\/p>\n<ul>\n<li>Finding a Correlation ID error:<\/li>\n<\/ul>\n<p>One of the most annoying bugs that SharePoint administrators will come across is the fierce &#8216;red X&#8217; with a mysterious correlation ID error. If this is the issue, a SharePoint Administrator must go through the logs and figure out the cause, which is no doubt uniformly boring.<\/p>\n<p><a href=\"http:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2016\/10\/Correlation-ID-Error.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-587\" src=\"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2016\/10\/Correlation-ID-Error.png\" alt=\" \" width=\"949\" height=\"427\" \/><\/a><\/p>\n<p>Wouldn\u2019t it be nice if there was a command that will search the log files for the correlation ID?\u00a0 The command Merge-SPlogfile will automatically search the logs for the error ID. Better than that, the command will search ALL the servers in the farm and place a log file on the server that you will the command.\u00a0 Here is an example of the the Merge-SPlogfile command:<\/p>\n<p>What if there was a command that could find out all the log files for the correlation ID? Wait! There is actually one. The command Merge-SPlogfile will involuntarily search the logs a foe a specific error ID.\u00a0 Bliss is the above command can search your entire firm\u2019s server and can place a log file. This is how the Merge-SPlogfile command work.<\/p>\n<p>Merge-SPLogFile -Path -Correlation &lt;Guid&gt;<\/p>\n<p>(Our <a href=\"http:\/\/www.softreeconsulting.com\/offshore-sharepoint-developers\/\">SharePoint Developers<\/a> generally run the command like above using the Correlation ID from sample error above.)<\/p>\n<p>Merge-SPlogfile \u2013Path c:\\log.log \u2013Correlation ba05e237-0680-403a-b9f6-e49f96ac55d4<\/p>\n<p>(That will put a .log file on the C drive of the server which will only include errors with the correlation ID.)<\/p>\n<p><strong>Quickly restore a deleted site collection. Strictness Miscommunication<\/strong><\/p>\n<p>The other day our <a href=\"http:\/\/www.softreeconsulting.com\/offshore-sharepoint-developers\/\">OffShore SharePoint developers<\/a> were asked for help by a client, who accidentally deleted a core site. It was very important for him to get it restored ASAP!! Our developers were frenzied hear the story, which was like this \u201cHi there, I accidentally deleted my site and the irony is I deleted the files from the <strong>TRASH<\/strong>. I don\u2019t know the process to restore the from this point, please help\u201d<\/p>\n<p>Luckily, one of our fellow mates murmured a spell, which was \u201cHa&#8230;It\u2019s easy, just use PowerShell to find the site and then restore it\u201d. And this is exactly what we did, which took only 10 minutes.<\/p>\n<p>Here goes the codes, we used luminously:<\/p>\n<p>Get-SPDeletedSite | select Path , siteid<\/p>\n<p>(This will produce a list of all deleted sites and their GUIDs as seen below)<\/p>\n<p><a href=\"http:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2016\/10\/Deleted-Sites.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-588\" src=\"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2016\/10\/Deleted-Sites.png\" alt=\" \" width=\"974\" height=\"59\" \/><\/a><\/p>\n<p>Then, run the command:<\/p>\n<p>Restore-SPDeletedSite -Identity (SITE ID)<\/p>\n<p>(in this case,<\/p>\n<p>Restore-SpDeletedSite \u2013Identity 4bff0c0e-4d56-4fec-8174-a60a16daeaac)<\/p>\n<p>This final command will definitely\u00a0 restore the site<\/p>\n<p><strong>\u00a0This solution is brought to you by Softree Consulting &#8230;.<\/strong><\/p>\n<p><em><a href=\"http:\/\/softreeconsulting.com\/\">Softree Consulting <\/a>employs SharePoint consultants, who are experienced in writing for a multiplicity of SharePoint verticals including technical, promotional, creative, branding content, cataloguing and ethical media comprising journalism.<\/em><\/p>\n<p><em>With more than 10 years of industry experience these professionals have the best resources to deliver optimum results. They have been satisfying customers with some of the best SharePoint Strategies. In case you need experts for <a href=\"http:\/\/www.softreeconsulting.com\/offshore-sharepoint-developers\/\">Offshore development for SharePoint 2016<\/a>, we have got you covered.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SharePoint is undoubtedly a piece of art and it can drive business organizations of all sizes. However, sometime it causes chaos for its administrators, which leads to frustration and would require a huge amount of time to undergo tedious coding. Before that disappoints you, we want to confirm that there are PowerShell commands that can make the process a walk [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":589,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127,43],"tags":[],"class_list":["post-586","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-365","category-sharepoint"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A Sneak Peak into the List of useful PowerShell Command Prompts - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Sneak Peak into the List of useful PowerShell Command Prompts - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"SharePoint is undoubtedly a piece of art and it can drive business organizations of all sizes. However, sometime it causes chaos for its administrators, which leads to frustration and would require a huge amount of time to undergo tedious coding. Before that disappoints you, we want to confirm that there are PowerShell commands that can make the process a walk [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-05T07:46:00+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Sneak Peak into the List of useful PowerShell Command Prompts - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/","og_locale":"en_US","og_type":"article","og_title":"A Sneak Peak into the List of useful PowerShell Command Prompts - Softree Technology","og_description":"SharePoint is undoubtedly a piece of art and it can drive business organizations of all sizes. However, sometime it causes chaos for its administrators, which leads to frustration and would require a huge amount of time to undergo tedious coding. Before that disappoints you, we want to confirm that there are PowerShell commands that can make the process a walk [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/","og_site_name":"Softree Technology","article_published_time":"2016-10-05T07:46:00+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"A Sneak Peak into the List of useful PowerShell Command Prompts","datePublished":"2016-10-05T07:46:00+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/"},"wordCount":638,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#primaryimage"},"thumbnailUrl":"","articleSection":["Office 365","SharePoint"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/","url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/","name":"A Sneak Peak into the List of useful PowerShell Command Prompts - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#primaryimage"},"thumbnailUrl":"","datePublished":"2016-10-05T07:46:00+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/sneak-peak-list-useful-powershell-command-prompts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"A Sneak Peak into the List of useful PowerShell Command Prompts"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=586"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/586\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}