foreach-object uses multiple scriptblocks in the 'process' stage
foreach_object can execute multiple scriptblock arguments in the 'process' stage<#c:#> 1..4 | foreach-object {} {$_} {2*$_} {3*$_} {'-'*40} {} 1 2 3 ---------------------------------------- 2 4 6...
View ArticleOutput format
Hello,This is a small part of a much larger script, but when I test this portion I receive some unexpected output from the exchange management shell.Basically this script reads a csv file, assigns the...
View ArticleRemove folders and contents after X days from an external drive root
Hi all second post, similar subject... Go easy please !As per my previous post which was answered by @mjolinorThe code I had worked fine when the files and folders where already contained in a folder....
View ArticleBuilding a string from a Get-ADComputer output adds @{Name= to the computer name
I am creating a script to collect all the machines with certificates installed on them. After gathering what type of computer I want (based on a character in the name) I run Get-ADComputer to get my...
View ArticleAdd multiple users to AD Group using AddRange
All,I am trying to add multiple users to an AD security group using AddRange method but no luck.Reason why I am using AddRange method is, the memberlist is pretty big (30K users) and Quest or MSFT AD...
View ArticleNew-ADUser "access to the attribute is not permitted"
The following code produces the error "New-ADUser : Access to the attribute is not permitted because the attribute is owned by the Security Accounts Manager (SAM)"$user = Get-ADUser -Identity...
View ArticleHelp writing a excel function to a cell using powershell
I have been working on a function that will write worklog information to an excel template. I am able to get it to work but once i added the date column and tried to write a excel function to it I'm...
View ArticleFunctions from Module Scoping Question
Hello,I have the following case:I`m using module that contains several functions, some of them are executing commends in remote sessions. These functions are used from Powershell Script. The issue is...
View Article[console]::setcursorposition
I got error when try to use [console]::setcursorposition. Any suggestion? Thanks.PS C:\> [console]::setcursorpositionOverloadDefinitions...
View ArticleDeclaring [T] (Of Type) with Powershell
I'm trying to call a method with Powershell that requires an "Of Type" or [T] according to the OverloadDefinition, Ie.OverloadDefinitions -------------------...
View ArticleUsing PowerShell to get VM Inventory
Hi,i am running the below to get the VM inventory. However i need the syntax to get the VHD information / size.Get-SCVirtualMachine -VMHost HOSTNAME -VMMServer LocalHost | Select-Object Name,...
View ArticleIE 10 Download Manager
Are there some functions/docs can be used in PS to control Download Manater in IE10?
View ArticleRetrieve event log entries from remote PC?
I need to retrieve the top N "Application" event log entries for a given remote machine. Specifically, I need the Time, Source, and Message (non-truncated) column outputs. How best to do this?thanks
View Articleinteraction between elevated PS session and non-elevated processes
Mighty all, I'm trying to leverage the following code to interact with instances of powerpoint running on a system[Runtime.InteropServices.Marshal]::GetActiveObject('Powerpoint.Application')All works...
View ArticleRead a CSV file and dynamically generate the insert
I have a requirement where there are multiple csv's which needs to be exported to a sql table. So far, I am able to read the csv file and generate the insert statement dynamically for selected columns...
View ArticleNeed help!! - Macro (Excel), working with Powershell
Need help with an macro for excel or translation the script to powershell in general.1) Macro is saved inside an excel-file as "mappe1.xlsm" This macro should open different excel-files inside a folder...
View ArticleWriting a powershell script that will get the archive bit status of SQL...
Hi All,I started looking at a project to check the archive bit of SQL backup files. The scope of the project is as follows.Connect to a SQL instance from an inventory DBGet a list of the backup drives...
View ArticleBlank spaces in script table output
Hi All, I have a script that checks for the existence of Exchange MailUsers, Mailboxes and NonExistent users based on the contents of a CSV file. All is working as expected, however the output is...
View ArticleDSC configuration data for Script resources
Hi,I'm trying to use PowerShell DSC to modify a settings file for an in-house application. I'm able to pass configuration data to File resources, but the same syntax doesn't work for Script resources...
View ArticleHotfix scan - Existing script but I want to write out to csv
Hello,I have a working script that reads in a list of computers and scans them to ensure a hotfix was installed. I want to make a few modifications to this script:Write out to a csv file.How do I scan...
View Article