Showing posts with label newsgroup. Show all posts
Showing posts with label newsgroup. Show all posts

Monday, March 26, 2012

Powershell?

Hi,
Do any folk here use SMO from PowerShell?

I've found a limited number of web postings about the subject, but not much newsgroup/forum chat.

Specifically, I'm wondering how to capture exceptions raised by SMO calls.
For example, I wanted to drop all logins on a server, so thought I'd try this:
$sql = new-object 'microsoft.sqlserver.management.smo.server' 'servername'
$sql.Logins | %{$_.Drop()}
which throws this error for every login:
Exception calling "Drop" with "0" argument(s): "Drop failed for Login 'BloggsJ'. "
At line:1 char:24
+ $sql.Logins | %{$_.drop( <<<< )}

Is there more information to be had? I've tried defining an object as microsoft.sqlserver.management.smo.smoexception but I'm not quite sure what to do with it...

TIA,
Robin.

Do a search on the web for "PowerSMO" and you will find a number of tutorials I wrote on using SMO and PowerShell.

Dan

Friday, March 23, 2012

Posts to the Newsgroups

Question:
I have posted several times to this newsgroup - going back at least six
months. I needed to refer back to one of those posts. But when I do a search
on my name, the results only show four posts?!?
I know thi isn't right because I've done the exact same search and received
a LOT more results than I'm getting this time around. The results are only
showing posts from July forward.
What's the deal?
Thanks!
The NNTP servers are purged of posts older than 90 days. groups.google.com
if your friend.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
news:C555008F-91E5-435F-8BF5-FD513D95D948@.microsoft.com...
> Question:
> I have posted several times to this newsgroup - going back at least six
> months. I needed to refer back to one of those posts. But when I do a
search
> on my name, the results only show four posts?!?
> I know thi isn't right because I've done the exact same search and
received
> a LOT more results than I'm getting this time around. The results are only
> showing posts from July forward.
> What's the deal?
> Thanks!

Posts that are posted does not appear in the posted list

Hi,
I have posted a query in this newsgroup 5 hours ago and the post has not yet appeared in the list of posts.
Any suggestions?
Thanks
I see several posts from you about deploying MSDE. My suggestion? Use a
real newsreader.
http://www.aspfaq.com/5007
http://www.aspfaq.com/
(Reverse address to reply.)
"sm" <sm@.discussions.microsoft.com> wrote in message
news:2C8A1929-4674-43ED-AD1F-8C46065F0ACB@.microsoft.com...
> Hi,
> I have posted a query in this newsgroup 5 hours ago and the post has not
yet appeared in the list of posts.
> Any suggestions?
> Thanks