Powershell 2.0 and Sql server 2005 help
I am trying to figure out a way using either powershell or command line to confirm that as data base is online after I started the Database service? I find some commands out there but they don't seem...
View ArticleReply To: Powershell 2.0 and Sql server 2005 help
It all depends on how you want to Connect etc. But this is an outline of how you could do it: $connectionString = "connectionstring" #open database connection to SQL Server $conn = New-Object...
View ArticleReply To: Access Parameter in SetScript member of Script Resource in Desired...
So, I don't think your structure is right. Your Script item should contain ONLY a GetScript and TestScript section. But both of those are actually OUTSIDE your Script item. The Write-Verbose isn't in...
View ArticleReply To: Concatenation Variables Problem with extra space
That's because you're using Write-Host and passing it two parameters. "$($_.ServerName)$($blah.ShareName)" You should look into Join-Path, though. It's specifically designed for joining path components.
View ArticleReply To: SMBShare PSSessionConfoguration Error
If you limited the configuration so that it can't load PSDrives, this can happen. The shell wants to start in a directory, but if it doesn't have a drive, it can't. And the SmbShare module in...
View ArticleReply To: SMBShare PSSessionConfoguration Error
I never thought of it! I'll try it, thank you!
View ArticleReply To: Access Parameter in SetScript member of Script Resource in Desired...
ohhh. Really Sorry..its a typo mistake The Correct is… Configuration MyConfig { param($MyComputerName) Script MyScript { SetScript = { Write-Verbose "Computer Name is : $MyComputerName" } GetScript =...
View ArticleGroup Membership Add-Remove based on .csv
I'm attempting to add Active Directory Users to Groups. I have a file with a list of classes and Login Names. (attached) Each line in the file contains a class name (class_name) and a Login Name...
View ArticleReply To: Group Membership Add-Remove based on .csv
There are many ways to handle things. For instance, if only people in the spreadsheet are supposed to be in the group, you could just remove everyone and then run the code above. You can also do...
View ArticleReply To: Group Membership Add-Remove based on .csv
Compare-Object Edited the code as Rob Simmers import CSV example was better, this is just a different way to do the foreach loop at the bottom of his code. $ad = Get-ADGroupMember $classNameFiltered...
View ArticleReply To: Broken forum topic
Strange must be my work Computer then. I'll try it later from home! As long as it works for you I'm fine with it just thought it was weird
View ArticleReply To: service status using powershell
What also might be useful to you is: Export-Xlsx http://gallery.technet.microsoft.com/office/Export-XLSX-PowerShell-f2f0c035
View ArticleStrange behavior with the Get-Alias cmdlet
Does anyone know why the following command treats the dollar sign as a wildcard instead of a literal: Get-Alias -Name ? Is there a way to use an escape character to treat the dollar sign as a literal...
View ArticleReply To: Strange behavior with the Get-Alias cmdlet
Escape it using a back tick. The cmdlet doesn't have a -LiteralName parameter.
View ArticleReply To: Strange behavior with the Get-Alias cmdlet
Same results using the back tick to escape it: Get-Alias -Name `? Looks like internally, the Name parameter of Get-Alias must do a "like" match on the value entered as the following returns the same...
View ArticleReply To: Strange behavior with the Get-Alias cmdlet
Sweet. The new code formatter works awesomely.
View ArticleReply To: Strange behavior with the Get-Alias cmdlet
Even the back ticks work in the new code formatter Clicking the "Preformatted" button once is all that's needed which results in "pre]{content}[/pre" being added. I replaced the content including the...
View ArticleReply To: Strange behavior with the Get-Alias cmdlet
Based on responses from @SystematicADM that I received on Twitter, both of the following work so these are ways to escape the wildcard searching and search for the literal question mark without having...
View ArticleRedundancy of Code in Advanced Function
This function is something I wrote a while back and now that I'm going back through it, the following line appears to be redundant since the script wouldn't have made it to this point if $VM didn't...
View Article