Friday, October 5, 2012
Replacement Commands
get-content <file> -last 5
To watch a log file ...
get-content <file> -wait
but not exactly the same functionality. So a better way is to get the command from Microsoft.
Tail is included in the 2003 Resource Kit and works well in Server 2008 environment.
Download tail here:
http://www.microsoft.com/download/en/details.aspx?id=17657
Wednesday, September 19, 2012
Ed Wilson
Favorite Past Events
http://ewblog.edwilson.com/ewblog/post/2012/03/06/Windows-PowerShell-for-the-busy-admin.aspx
Ed and Teresa Wilson will be in the house! Meeting Date: Tuesday, October 2, 2012 - 18:30 - 20:00 Location Improving Enterprises 4449 Easton Way, Suite 100 Columbus, OH43219 See map: Google Maps Read more http://powershellgroup.org/content/powershell-saturday
Thursday, June 14, 2012
Tips and Tricks in 3.0
Latest
From Scripting Guy 5 new tips and tricks
Create PowerShell profiles
http://msdn.microsoft.com/en-us/library/windows/desktop/bb613488(v=vs.85).aspx
help * (man for linux)
New window popup
help get-service -showwindow (v2 help get-process -online )
Auto build you commands
show-command get-wmiobject
Help can get updates
update-help (save-help)
Find the verbs
Get-verb
Find the verbs and count
Measure-object
If you have a conflict
microsoft.powershell.management\get-process
One Line is Magic
get-process | kill -whatif
get-process | kill -confirm
get-process [a-r]*[g-w] | kill -whatif
does it work well in a pipeline?
get-help get-service -full
PowerShell 3.0
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/WSV321
Check out whats new in powershell 3.0
http://technet.microsoft.com/en-us/library/hh857339.aspx
Guides from Technet Library
http://technet.microsoft.com/en-us/library/bb978525.aspx
Wednesday, June 13, 2012
Manage SharePoint Users with PowerShell
http://technet.microsoft.com/en-us/library/ff678226.aspx
Examples
Adding users and claims to a site from PowerShell
http://blogs.msdn.com/b/brporter/archive/2010/12/02/adding-users-and-claims-to-a-site-from-powershell.aspx
Changing the Item-Level Permissions Settings for a Document Library requires PowerShell http://www.hersheytech.com/Blog/SharePoint/tabid/197/entryid/28/Default.aspx
PowerShell script to capture and report on all SharePoint permissions through a site collection http://localgovernmentsharepoint.wordpress.com/2012/01/25/powershell-script-to-capture-and-report-on-all-sharepoint-permissions-through-a-site-collection/
The PowerShell script I (Todd) use to create Active Directory users http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=362
Tuesday, May 29, 2012
Using Powershell to change powerpoint themes
Getting ready to give a presentation and noticed that all 14 modules are using the wrong theme. Started in changing the theme on the seeming endless list of files and I thought, how about powershell. Well after a quick search found this great article from Ed Wilson, thank you again ED! http://blogs.technet.com/b/heyscriptingguy/archive/2010/05/11/hey-scripting-guy-may-11-2010.aspx
I did simplify his code by just using one folder that contains both the theme an PowerPoint slides. Just change $themepath to the name and location or your theme and $path to the folder location of your powerpoint slides are you are set.
Add-type -AssemblyName office $Application = New-Object -ComObject powerpoint.application $application.visible = [Microsoft.Office.Core.MsoTriState]::msoTrue $themePath = "c:\presentations\moc.thmx" $path = "C:\Presentations" Get-ChildItem -Path $path -Include "*.ppt", "*.pptx" -Recurse | ForEach-Object { $presentation = $application.Presentations.open($_.fullname) $presentation.ApplyTemplate($themePath) $presentation.Save() $presentation.Close() "Modifying $_.FullName" } $application.quit() $application = $null [gc]::collect() [gc]::WaitForPendingFinalizers()