Author: jbmurphy
-
PowerShell to get a users DistinguishedName
Why can’t I remember that to find a user’s Distinguished Name all i have to do is type the PowerShell cmdlet: Get-ADUser username And for a group: Get-ADGroup groupname And for a computer: Get-ADComputer computername Why can’t I remember that? It is also a quick way to find the OU of an object!
-
How to setup a remote syslog server in CentOS 6
I wanted to have a cisco device send it’s logs to a Centos box for troubleshooting. I just wanted to do a “tail -f” against the error logs. Seems that syslog is now rsyslog in Centos 6. To setup rsyslog to accept syslog logs from other devices, you need to: 1. uncomment out the following…
-
PowerShell code to query a table, and put the XML results into a SharePoint Document Library
If you look at this prior post, I showed how you can use an xml file in a document library as a source for an input box’s jQuery autocomplete. I wanted to automate the creation of these XML files and upload them to a SharePoint Document Library. For example, I wanted to query Microsoft CRM…
-
Update CRM 2011 from an Excel Sheet using PowerShell and the oData/REST endpoint
Let’s say you exported a group of Contacts from CRM 2011 using the “Export to Excel” button and you selected the “Make this data available for re-importing by including required column headings” button. The important thing that this does is it adds the GUID for the contact to the first column. Now, let’s say you…
-
PowerShell Modules – Export-ModuleMember only if plugin is installed!
I have been working to move my scripts to modules. It just occurred to me that I can conditionally Export-ModuleMember if a plugin is installed. For example: Or I could export based on $env:computername. I like that idea. Only this scripts that are supposed to run on that machine are available! This just occurred to…
-
My PowerShell command to backup SQL server
Below is my PowerShell code to backup SQL servers. This will create a folder in the destination with the ServerName, then a subfolder with the date, and then a subfolder with the hour. You can backup a single database or all of them. You must have the PowerShell SQL snap ins installed: Add-PSSnapin -name SqlServerProviderSnapin110…
-
How we recovered from a Microsoft SQL 2005 suspect msdb database
I am not a MS SQL Server guru. Honestly, it is a “set it and forget it” technology for me. After our last patching episode, we ended up with a SQL Server Agent offline, and our msdb file was listed as suspect. Seems like there are 2 ways to recover from this. 1 restore a…
-
Using cURL to pull Google Reader starred items – Part 2 UnStaring in Google Reader
In the first part of this tutorial, I pulled a couple of variables from the XML feed of my Google Reader’s “starred items”. Now I wanted to “process” the item and UnStar it. This was not easy for me to put together – it was my first attempt at working with the Google API. First…
-
Using cURL to pull Google Reader starred items – Part 1 xpath
A while ago, I wrote a post about using ruby to parse the xml feed of shared starred items in Google Reader. One thing that I did not like about this solution was that I could not get the URL AND mark the item as un-starred. Since I had been playing with REST in these two…
-
PowerShell code to update a CRM 2011 field (using REST/oData)
In this earlier post I showed how to loop through all the contacts in CRM 2011. Next thing I wanted to do was to update a field on each Account. So I needed to figure out how to update data, not just read it. Here is the code to do that:
