Reply To: Retrieve event logs for boot time
The efficient way to do that, then would be to run:$computernames = Do-Something-That-Gets-Computer-Names Invoke-Command -Comp $computernames -ScriptBlock { Get-WinEvent -Whatever -Whatever }...
View ArticleReply To: Unable to update SQL Table
Hi Don,Thanks for your reply.I have attached the txt file for your reference.Regards, MohammedThe SQL Query:function Save-MSSystemInfo { param ( [Parameter(Mandatory=$True,ValueFromPipeline=$True)]...
View ArticleReply To: Unable to update SQL Table
You have a trailing comma in your SET clause, right before WHERE (after Sockets = $($InputObject.Sockets) ).
View ArticleReply To: Unable to update SQL Table
Also, you should add [CmdletBinding()] before your Param() block. Would make Write-Debug a lot more useful.
View ArticleHandling errors when using methods
Hi Don,I’m always struggling with methods resulting in the error: You cannot call a method on a null-valued expression. For example: $Users = Get-ADuser -Filter {DisplayName -like ‘Jon*’} -Properties *...
View ArticleReply To: Handling errors when using methods
Hi. Keep in mind I’m not the only on here, though . If you ask for me specifically you may keep some other helpful folks from offering an answer!You’ll want to use a Try…Catch block (help about_try*)....
View ArticleReply To: AD module remoting problems
Just remembered I hadn’t answered on this one. I have changed the script and it works great now thanks. I downloaded the Quest cmdlets and it works like a charm. Thanks again for such a fantastic...
View ArticleReply To: Where is "UseLocalScope" set by PSRemote endpoint
According to the help pages, using the SessionConfigurationFile parameter set for Register-PSSessionConfiguration allows me to specify a .pssc file created by New-PSSessionConfigurationFile and a...
View ArticleReply To: Handling errors when using methods
Thanks!Result should look like this:$Users = Get-ADuser -Filter {DisplayName -like 'Jon*'} -Properties * $UserObj = @() Foreach ($User in $Users) { $ErrorActionPreference = "Stop" Try {$LastLoggedOn =...
View ArticleReply To: How to start process remotely with admin console
Hi Dave,I tried this from my workstation:psexec \\Myserver -i powershell -command start “E:\STARTUP\StartNStopFiles\SyncDB_recover” -WindowStyle minimized -ArgumentList GP01But it doesn’t work, same as...
View ArticleReply To: Retrieve event logs for boot time
Great! Thanks again Don, that’s really helpful and will help get me on the way to getting what I want.As far as SQL… well, that’s another thing I’ll have to learn then. Excel, in this case, gets me...
View ArticleReply To: Where is "UseLocalScope" set by PSRemote endpoint
OK. Passing that along. You have to be careful about “implication” in the docs, but officially, you can’t do what you want in the current version. The technology doesn’t have a way to start up an...
View ArticleReply To: Retrieve event logs for boot time
I’m actually working on a SQL Server book right now for the Lunches series. But, meantime, one of the free ebooks here (go to the Newsletter tab) has a module that simplifies basic SQL Server use,...
View ArticleHow to install a add-on into ISE?
Hi all,I am trying to figure out how to install Doug Finke’s PSharp add-on into PS ISE.I downloaded the zip file from github & it contains a number of .ps1 files in a couple of different...
View ArticleReply To: How to install a add-on into ISE?
It looks like as long as ConvertTo-PSCustomObject.ps1 , Edit-Live.ps1, and New-FunctionFromSelectedText.ps1 are in the same directory as your profile script, what you did should work okay. The first...
View ArticleReply To: Unable to update SQL Table
Champion Guys…this is excellent stuff…makes a wonderful tool.I am currently working on building a tool with combination of PowerShell + PowerCLI + SQL and a web dashboard(Wavemaker and Tomcat)I will...
View ArticleInstall Get-ADComputer
I see a lot of reference to the command ‘get-adcomputer’ but I don’t seem to be able to install it. One source that I looked at suggested that I use ‘install-windowsfeature’. When I try to get help on...
View ArticleReply To: Install Get-ADComputer
The ActiveDirectory module, which contains Get-ADComputer and the other AD-related commands, is installed on Windows Server 2008R2 and later domain controllers. It is also available as part of the...
View ArticleReply To: How to install a add-on into ISE?
Dave,Thank you for the info, works like a charm!
View ArticleReply To: Retrieve event logs for boot time
Thanks again Don. I’ll download and check out the eBooks. I’ll start on them when I finish the PowerShell lunches in a hand full of days. And thanks again for the help.
View Article