Viewing 15 posts - 16 through 30 (of 64 total)
Any errors or does it just exit? Are you doing any logging that might help point to the issue?
I do something similar but have one server that would throw...
August 16, 2013 at 3:05 pm
Glad you go it to work but as an alternative consider
$InstanceObject = New-Object (’Microsoft.SqlServer.Management.Smo.Server’) -argumentlist $InstanceName
$InstanceObject.Databases | Select Name, RecoveryModel | Foreach {
Write-Host $_.Name $_.RecoveryModel
...
August 9, 2013 at 2:34 pm
It depends, what information do you want? Have you tried anything and if so what happend?
July 1, 2013 at 2:22 pm
26 seconds versus 10+ minutes sounds like a winner to me.
The $i—was to go backward through the $Results list since removing an item changed the indexing causing the errors...
October 15, 2012 at 1:01 pm
OK, that was one of those "other ways" I initially mentioned but I was trying to stay with your original request. Either way I'm glad you got it working.
However,...
October 15, 2012 at 11:11 am
I must have changed the ErrorActionPreference in the console in which I tested my answer. I didn’t get the error last week but do today.
Anyway, give this version a...
October 15, 2012 at 10:03 am
Here's one way, there are probably more.
foreach ($result in $results) {if ($remove -contains $result.split(",")[1]) { $results.Remove($result) }}
October 12, 2012 at 12:34 pm
That makes sense. I’ve seen AD groups created or modified but not seen the addition/change for almost 5 minutes until it finally propagated to other controllers.
So you’re welcome but...
July 20, 2012 at 11:04 am
I didn't do the create database part but testing the Powershell from your OP works for me with only one change.
I hardcoded the DefaultDatabase for both logins to...
July 19, 2012 at 11:53 am
That's an odd one. The code looks like what I have in my SQL Server installer script and you say it works on the first server.
I guess it's...
July 19, 2012 at 9:21 am
While I agree with Jason here's a way to change the sa passwords and still have different passwords. The Powershell script reads the server name and password from a...
July 17, 2012 at 9:55 am
Have you tried to change the part where it says
$msg.body = $msg.body + "`n `n FAILED JOB INFO:... [snip]
to something like this
$sql = "insert YourTableName (server,...
July 11, 2012 at 12:16 pm
Here's a regex that might work for you.
$cn = 'CN=Admin-Lastame\, Paul,OU=Users,OU=Data_Admins,OU=Admins,DC=....'
$pat = 'CN=\w+\-(\w+)\\,\s+(\w+),.*$'
[regex]::Replace($cn, $pat, '$2 $1')
It returns Paul Lastame
Edit: just reread your op. rewritten for just firstname lastname
Edit2: I...
July 9, 2012 at 2:43 pm
You'll have to modify the output formating to fit your needs but this is a very verbose way to list files for all filegroups and databases.
$sName = 'mysrr'
$server = new-object...
May 24, 2012 at 7:26 am
Viewing 15 posts - 16 through 30 (of 64 total)