Reply To: get-childitem output
Use Get-ChildItem to get all desired file types. Sort by filename extension and then by file size, if you like; use Format-Table to group by filename extension, which will separate the different file...
View ArticleReply To: Suggestion: EnhancedHTML2: Highlighting a single cell in a row
Hi Don You've given me food for thought. I'm going to see if I can achieve what I want without customising EnhancedHTML2.
View ArticleCreate new local admin user
Hi, I have a task to create a new local user on all clients in domain (windows server 2008 r2 f/d functional level – windows 7 clients) which would be a member of local admin group on these clients....
View ArticleConfigure Preferred and Alternate DNS Settings
Can anyone help me in using DSC to set preferred and alternate DNS server settings on client servers? I've configured an http pull server, but am getting stumped as to what needs to be done next....
View ArticlePSRemoting – PSSessionConfiguration – Using PSSnapin in...
I have been playing with creating my own PSSessionConfiguration in PS V3 on 2008 R2 Enterprise SP1. For the most part I've been able to successfully get most aspects working, but I am puzzled when it...
View ArticleIf statement with -and Never worked
Hey Guys I have problem with using the if statement with the -and. I've tried several times but never worked, I am writing this simple script and I really need someone to tell me what I am doing...
View ArticleReply To: Create new local admin user
Hi Bojan, The security risk attached to GPP or a PowerShell script in a GPO is pretty much identical because the password is stored (even if obfuscated) in an easily accessible location. I think...
View ArticleReply To: Sharepoint 2010 Remote Admin
Hello Tim, I think you're experiencing a double/second-hop problem. You're credentials are not being delegated to a remote server like SQL while using the SharePoint cmdlet. You'll need to look into...
View ArticleReply To: Sharepoint 2010 Remote Admin
One more article which might help: http://preview.tinyurl.com/o7klsas
View ArticleReply To: If statement with -and Never worked
Hi Mahmoud, I suspect the Caption of Win32_OperatingSystem is not set to what you're expecting. Please run below and post the output: (Get-WmiObject Win32_OperatingSystem -ComputerName $Computers...
View ArticleReply To: If statement with -and Never worked
Hi Just tested this out on my computer and noticed that if I run only: If ($OS -eq "Microsoft Windows 7 Enterprise") It would still evaluate to be false. Checking the output shows that it for some...
View ArticleReply To: If statement with -and Never worked
You can trim the $OS string or only match what you're looking for: Trim example: If (($OSArch -eq "64-Bit") -and ($OS.Trim() -eq "Microsoft Windows 7 Enterprise")) Match example: If (($OSArch -eq...
View ArticleReply To: If statement with -and Never worked
other alternative is to use -like If (($OSArch -eq "64-Bit") -and ($OS -like "*Windows 7 Enterprise*"))
View ArticleReply To: Suggestion: EnhancedHTML2: Highlighting a single cell in a row
Hi Don Here's the code I ended up with: # Prepare html email $cssLeft = { if( $_.Warnings -ne "0" ) { "left red" } else { "left" } } $cssRight = { if( $_.Warnings -ne "0" ) { "right red" } else {...
View ArticleReply To: Create new local admin user
Try this script: # Script to create local admin account on many computers # Note: New local admin password will be saved to the log file. # New local admin password must meet minimum password...
View ArticleView Past Powershell Scripts
Quick Question….. I'm new system admin for Exchange Server and wanted to know if there was a way that I could view/export scripts used by other admins in the past to compare my current scripts for...
View ArticleAdd registry key
I have to run this command remotely: set-ItemProperty-Path 'hklm: \ \ SOFTWARE \ Microsoft \ PowerShell \ 1 \ ShellIds \ Microsoft.PowerShell \'-Name "ExecutionPolicy"-Value "RemoteSigned" It only...
View ArticleReply To: Convert to multithreading
This script http://gallery.technet.microsoft.com/Powershell-to-create-many-1b4f6f37 shows an example of using Start-job, Get-job, Receive-job, Remove-job to run a PS script in several...
View ArticleReply To: Add registry key
Jacko, please see example of running remote commands in the post http://powershell.org/wp/forums/topic/powershell-ruan-as-administrator/
View ArticleReply To: Newbie with Copy question
# Copy example # # Use this command to see how to use Copy-Item commandlet help Copy-Item -Full # $Source = "d:\files\MyFile.txt" # or "\\server1\share1\folder1\file1.txt" $Target = "\\PC1\d$\folder\"...
View Article