Forum Replies Created

Viewing 15 posts - 196 through 210 (of 482 total)

  • RE: Fail sql job if error is encountered in powershell script

    How about a try-catch around the first step. Set a variable indicating success or failure, then do step 2, and then throw that variable?

  • RE: Forms and controls

    Hi Gaz,

    I'm doing this in PowerGUI, BTW.

    I guess strictly speaking it's more of a .net / Windows forms question, but I am doing this all in PoSh.

    I've replaced a...

  • RE: Domain Group Login Fails

    OK... Does it work for all the users that are members of that group?

    If it does, then it's not access to database xxxxx that's the problem.

    Does the sproc perhaps try...

  • RE: Domain Group Login Fails

    What happens when you try

    setuser 'domain\member of group'

    go

    use xxxx

    go

    setuser

    go

    execute as login = 'domain\member of group';

    go

    use xxxx

    go

    revert

    go

  • RE: Powershell and Excel and SQL Server

    Here's some feedback:

    I've found that the code below is considerably faster than my previous RBAR-CBAC solution -- although I think that's what's happening in the background of the where clause.

    $Rows...

  • RE: Powershell and Excel and SQL Server

    Thanks again Andy,

    I had arrived at the same solution: a VBA function to, er, highlight the rows of interest.

    Fortunately this is an ad-hoc type job that only needs to be...

  • RE: Powershell and Excel and SQL Server

    Thanks Andy.

    I had a look at the closed XML thing, seems rather complex for my needs.

    Let me get down to specifics: I have a worksheet object, got the range...

  • RE: Powershell and Excel and SQL Server

    I'm doing this in a loop: it's taking about .5 seconds/row to access these cells, + another .5 seconds for processing.

    $nId = $UserWorksheet.Cells.Item($intRow, 1)

    $cE_Description= $UserWorksheet.Cells.Item($intRow, 2)

    $cF_Description = $UserWorksheet.Cells.Item($intRow, 3)

    $nParent_Id= $UserWorksheet.Cells.Item($intRow,...

  • RE: pscustomobject help

    Yup, got it. Was not getting any values for Date because column name had a trailing space.

    Thanks Bruce.

  • RE: Multiple logins to single DB group

    We only have 1-way trust. The SQL Server domain trusts the outside domain.

    AD admin says groups from outside domain could not be members of local groups.

    We have a working solution...

  • RE: Powershell script enhancement

    Something like this?

    foreach ($CurrentlyProcessingDB in $MyListOfDBs)

    {

    if ($ListOfDbsToIgnore -notcontains $CurrentlyProcessingDB)

    {

    ...

  • RE: Multiple logins to single DB group

    45 DBs * 16 groups/Domain/DB = 720 logins.

    Each login maps to a DB user, which is a member of a db role.

    The roles already exist, as do the DB users...

  • RE: Multiple logins to single DB group

    Hi 360,

    I'd originally hoped to use nested AD, but my domain admin tells me "that ain't gonna happen" due to trust issues.

    At no point is any of this being done...

  • RE: Multiple logins to single DB group

    Thanks for the responses.

    While the logins are unavoidable, I was trying to avoid creating 700+ corresponding database users (groups, in this case). Lutz's response shows it's possible, but... from BOL...

  • RE: delete files before 8PM

    You were very close: this needs to be in brackets:

    ($_.lastWriteTime -lt ((Get-Date).AddHours(-6)))

Viewing 15 posts - 196 through 210 (of 482 total)