How do I parse the output from Get-WinEvent to only display the samAccountName?
Hi all, relative newcomer to PowerShell but loving it as I learn.Several months back I implemented a scheduled task that archives and clears all the Windows Event Logs on my three DC's. However, when...
View ArticleUsing PS to query service state on multiple servers
I'm trying to use the below PS command to query the service state on mulitple servers. However the command is only returning the first server in the list. And this command was copied straight from the...
View ArticleGetting errors for Add-Computer
I'm trying to pickup the error generated by add-computer on my powershell script. What I'm trying to achieve here is if I try to add a computer to a domain and it already exist I would like to ask the...
View ArticleHow to find a file with recent create date with a specific name
How to find a file with recent create date with a specific name.I have 5 files with names is as below, I have a requirement to find out the recent file among them using vbscript.All are located under...
View ArticlePowershell with winform and install-windowsfeature
hi,I have this strange issue with a powershell GUI I am creating. Basically I am building a small GUI that will install features and roles on windows 2012 servers. Here is the sample code:[void]...
View Articlewmi filter for a subnet
i am trying to apply a gp on a subnet I tried this Select * FROM Win32_IP4RouteTable WHERE ((Mask='255.255.255.255' AND NextHop='127.0.0.1') AND (Destination Like '10.1.7.%'))and this Select * FROM...
View ArticlePowerShell Web Services (Management oData IIS Extensions)?
There are references to this "Loch Ness" feature across Microsoft's announcements for both PoSh3 & 4; however, I am unable to locate anduseful, current documentation on PSWS. I even went as far as...
View ArticlePSv3 - Collection of objects dropping additional object properties
EDIT: I should add that the if block is only executed for some of the machines this is run against. So the D2fs property is only added to some of the records, not all.$output = @() do {$obj = new...
View ArticleNeed - HTML report with CSS/JS script
Hello,I want to build a HTML report where I can get PowerShell properties output in html and each properties should Expand and Collapse by click or mouseover.I tried but no luck. No able to club...
View ArticleExport-CSV but leave out first two lines
I am exporting data from AD, sAMAccount names to be exact, using Quest CMDlets.I use Get-QADUser | Select SamAccountName | Export-CSV C:\file.csvEverything works fine but in the output I get two rows...
View ArticleVBScript Elevated Permissions problem.
I've found just about every posting related to Elevated permissions with VBScript. I've been using one I found 5 years ago and it has worked like a charm up until recently. My scripting has...
View ArticlePrint spooler startup keeps resetting to manual
NONE of the threads on Print-Spooler problems on Technet forums (or anywhere) are pertinent to my problem. My P-S service runs FINE, and there are NO problems with printing. However, EVERY time I...
View ArticlePS modules download
Hello all I'm totally newbie in windows power shell. Please bear with me. I 'm using windows 7 and by default installation, it installs power shell either 1.0 or 2.0. I wanted to use latest power...
View ArticleCan you script changing Ownership of a Registry Key in Windows 7?
I'm planning the upgrade for my company to go from XP to Windows 7 Pro. I have a regedit in my current login script that modifies HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} and...
View ArticleCreate Shortcut In My Network Places Using PowerShell
Hello! How can one create a shortcut in My Network Places using PowerShell? I found a method described using VB at...
View ArticlePowershell: set .msg file date to date the mail was created.
Kind people.I've looked here: http://blogs.technet.com/b/heyscriptingguy/archive/2012/06/01/use-powershell-to-modify-file-access-time-stamps.aspxAnd...
View ArticleParse and return multiple strings from log files and export to .CSV file
Hi All, I'm trying to parse the following log file and output to a .CSV file. The log file is created by a utility called ROIScan which is created by MS for Office reporting.I need to search for...
View ArticleVB script not Running from task Scheduler
I am having some troubles running some simple vb-scripts that do not appear to run from Task Scheduler.The scheduled task is using the same currently logged-in account, which is a local...
View ArticleFetch users from other domain in different forest
Set objConnection = CreateObject("ADODB.Connection") objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" Set objCommand = CreateObject("ADODB.Command") Set...
View ArticleQuery AD Security membership and spilt results
Hi,I have a VBS script that list to a text file all AD security groups that user is member of. Problem is that query returns full distinguished name like "CN=Citrix MS Access...
View Article