Quantcast
Channel: PowerShell.org » All Posts
Browsing all 13067 articles
Browse latest View live

Using Invoke-Command to Import-Certificate gives Access Denied

Hello, New to this forum and new to PowerShell scripting. I am trying to build a script that will export a certificate from one system and import it to another. Here is the typical scenario… We will...

View Article


Reply To: Using Invoke-Command to Import-Certificate gives Access Denied

Is the .CER file on a network share? If so, you may be running into the "second hop" problem of remoting. There are many ways to get around this, but the simplest (and generally most secure) is to...

View Article


Reply To: Using Invoke-Command to Import-Certificate gives Access Denied

Dave, Yes, the CER file is in a shared folder being accessed via a UNC path. I'll try your suggestion and get back to you. Thanks, Shawn

View Article

Reply To: Mount-VHD requires Hyper-V role

The RSAT tools were already installed, Mount-VHD seems to specifically require the role to be installed.

View Article

Reply To: Bios Date -> year only

Thank you all for the replies. It all worked.. I ended up using the following: Get-CimInstance Win32_BIOS | Select-Object @{n="ReleaseDate";e={$_.ReleaseDate.year}}

View Article


Regular Expression -match operator

Hi All , 002707+002781+002773+002737+002728+002783+002774+002741+002960+002957 – Canadian Consumer Protection (FCAC) – String . I'm trying to use -match operator to only match if there is only 6...

View Article

Reply To: Regular Expression -match operator

/d{6} Matches exactly 6 digits. But the string above has 60 digits. I'm not sure I understand.

View Article

get-targetresource

I've used the examples in DSC Wave 6 (http://blogs.msdn.com/b/powershell/archive/2014/08/20/dsc-resource-kit-wave-6-is-here.aspx) and trying to create a custom DSC-Resource. Here I have one...

View Article


Reply To: Problem with certbased authentication at powershell remoting

This is a very strange behaviour …. we reproduced it on two additional machines and it takes a couple of hours to work. We can handle this but we are really interrested in the reason … any ideas?

View Article


Replacing Text in a foreach loop

I have a script that I am building that will get the contents of a directory into a var, then populate another var with the information from the first var but modified. I am not getting any errors,...

View Article

Reply To: get-targetresource

I would imagine that efficiency plays a part. In Test-TargetResource, you can just abort the function and return $false anytime you find anything wrong, instead of having to continue reading the rest...

View Article

Reply To: Problem with certbased authentication at powershell remoting

Are you generating new certificates at the time you reproduce the problem? Maybe you've got something quirky happening like the certificate's NotBefore value is set for 2-3 hours in the future...

View Article

Reply To: Replacing Text in a foreach loop

There are a few problems here: The param block must be the first non-comment line of a script or function; you've got New-PSSession and Import-PSSession commands that would need to be moved into the...

View Article


Output repeats several times

I'm trying to work with foreach loops to collect info and then outside the loops do an output of the final results, but it's outputting in an unusual manner. First it outputs the first listed server's...

View Article

Reply To: Output repeats several times

This is a very common approach in formal programming. It's not always a good approach for PowerShell. I would typically prefer to write my code as a function, and have it output one object at a time...

View Article


Reply To: Output repeats several times

I haven't tested your code, but it looks like you should have one line of output for each user account member of each group. If you're seeing 3 lines for the first group and one line for the second,...

View Article

Reply To: Importing Module

Thanks for the info! A little background on the script, I am building a script that will automate the setup process after a machine has been imaged, so currently the reason I have to go the route that...

View Article


Reply To: Replacing Text in a foreach loop

I am still not getting anything for the $Identity. I can see the items in the $Photo var, but $Identity is not being populated.

View Article

Reply To: Replacing Text in a foreach loop

Are you running the code that I posted, or has it been changed? I don't see how you can be getting a blank $Identity variable from the code in my last post.

View Article

Reply To: Replacing Text in a foreach loop

I am running the code that you posted

View Article
Browsing all 13067 articles
Browse latest View live