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

Reply To: Get-ADGroupMember with all user properties

Pipe the resulting objects to Get-ADUser (though it’s probably a good idea to make sure you’re actually looking at a user object first), like so: Get-ADGroupMember -Identity SomeGroup | Where-Object {...

View Article


Reply To: Comparing dates and then archive files greater than 14 days

If you cast a date time string as an actual datetime object, you can compare them.[datetime]$x = “11/22/1971 10:45 AM” $y = Get-Dateif ($x -gt $y) { #whatever }I believe the date you’re looking at on...

View Article


Reply To: WMI Access Denied

First, let’s try and simplify the problem a bit by eliminating the credential object. As a test, try doing the Get-WmiObject call, passing the “MACHINENAME\USERNAME” to -Credential. Let it prompt you...

View Article

Reply To: Set WMI Namespace Sec-Win2003-2008-Remotely Many servers

So.. I’m sorry, I don’t think I’m following what the question is.How do I ________?Fill in the blank?

View Article

Reply To: WMI Access Denied

Tried and keep doingGet-WmiObject : Access denied At line:1 char:1 + Get-WmiObject win32_process -ComputerName ’10.2.0.56′ … +...

View Article


Reply To: WMI Access Denied

So, just to be clear, you’re doing:Get-WmiObject -Class Win32_Process -ComputerName ’10.2.0.56′ -Credential ‘COMPUTERNAME\admsql’Replacing COMPUTERNAME with the machine’s actual NetBIOS computer name,...

View Article

Reply To: WMI Access Denied

Don, found the problem.When I use administrator it works fine. When I try to use the admsql, that is a account in the local administrator group, not works with access denied. We have Symantec endpoint...

View Article

Reply To: WMI Access Denied

Nope, no idea.

View Article


Reply To: WMI Access Denied

Thanks

View Article


Executing program on remote computer help

Hello and thank you for your time. Here is what I’m trying to do and the requirements behind it.PowerShell 2.0Must execute on remote computerScript so far:$RemoteDll = “c:\program files...

View Article

Reply To: Executing program on remote computer help

The script block you pass to Invoke-Command does not inherit any variables from your local scope. In this case, $RemoteDll is an uninitialized (null) value when the command runs on the remote computer....

View Article

Reply To: Executing program on remote computer help

Thanks Dave that did the trick!

View Article

Reply To: WMI Access Denied

Just to update you in case you can help others in the future, I have some great help in the MSDN forum, and it was UAC. Just disabled it

View Article


Reply To: Get-ADGroupMember with all user properties

thanks Dave!

View Article

Reply To: Help: if something equals a certain value, change value to...

Dave, I have a followup question. Again, this worked, but I’m a bit confused. According to the help files, Get-WMIObject does not accept pipeline input for the ‘computername’ property, but it appears...

View Article


Reply To: Help: if something equals a certain value, change value to...

You’re not piping anything directly to Get-WmiObject, in that example. It’s Select-Object that accepts the pipeline input. When you use a constructed property, the Expression is a script block that...

View Article

Reply To: Help: if something equals a certain value, change value to...

Using Select-Object in that way is sort of a nice shorthand for something like this: $creds = Get-Credential Get-ADComputer -Filter 'OperatingSystem -like "*2008*"' | ForEach-Object { $computer = $_...

View Article


Reply To: Watch Folder For A Missing File

Alright, thanks. How do I go about setting the flag? I think I need to create a new variable, and then if the file is there, set it to true, and if there is no file set it to false. I don’t know how...

View Article

Reply To: Watch Folder For A Missing File

You won’t be using the FileSystemWatcher at all. A simple Test-Path and/or Get-Item command will do.

View Article

Reply To: Require AD authentication before running script

Alright it all appears to work fine and I appreciate the help very much, but would you mind elaborating a bit on how it all works. I have never used try catch throw, and im not all that certain as to...

View Article
Browsing all 13067 articles
Browse latest View live