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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleExecuting 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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 ArticleReply 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