Giter Site home page Giter Site logo

Comments (6)

MikeFal avatar MikeFal commented on May 16, 2024

I have a couple thoughts on resolving the mapped user issue:

  • Throw a warning and continue if a mapped login is detected (like the other checks)
  • Add a -Force switch. If -Force is declared, it will drop the user from the database and then set the owner. Otherwise it will throw a warning.

Thoughts?

from dbatools.

ClaudioESSilva avatar ClaudioESSilva commented on May 16, 2024

Agree with the first one.

For the second one, why drop the user and not only set him as dbowner ?
Imagine someone set 'user1' (that have datareader permissions) as dbowner
but he was wrong and have to set 'user2' as dbowner, now, the user 'user1'
do not have the permissions (has lost datareader) he had before.

This makes sense to you?

No dia domingo, 21 de agosto de 2016, MikeFal [email protected]
escreveu:

I have a couple thoughts on resolving this:

  • Throw a warning and continue if a mapped login is detected (like the
    other checks)
  • Add a -Force switch. If -Force is declared, it will drop the user
    from the database and then set the owner. Otherwise it will throw a warning.

Thoughts?

β€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#156 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ASnfI98O4NMTLmddc-9uYZClY5uuac8Tks5qiHjHgaJpZM4JnazA
.

Cumprimentos,
ClΓ‘udio Silva


e-mail: [email protected]
linkedin: https://pt.linkedin.com/in/claudioessilva
twitter: http://www.twitter.com/claudioessilva

from dbatools.

MikeFal avatar MikeFal commented on May 16, 2024

You can't set a login as database owner if it exists as a user in the database. Adding it to the db_owner role is not the same as setting the database owner to a login. That's why we'd have to drop the user. I agree with your concerns that if the user gets dropped, you lose any permissions the user had. This is why they would need to use -Force to perform the user drop.

Powershell is a sharp knife. Be careful you don't cut yourself with it. ;)

Of course, I'm open to not doing this and simply throwing a warning if the user is in the database.

from dbatools.

ClaudioESSilva avatar ClaudioESSilva commented on May 16, 2024

That's true @MikeFal! I had forgotten this one!
That said I agree with the second one too πŸ˜„

from dbatools.

dansqldba avatar dansqldba commented on May 16, 2024

Additionally, it's not possible for AD groups to be database owners is it? I think we came across this in the DbaJobOwner cmdlets as well but it was fixed there, might need a check for that too.

from dbatools.

dansqldba avatar dansqldba commented on May 16, 2024

@MikeFal would you be happy for me to attempt to fix the issue I had with AD groups as database owners in Set-DbaDatabaseOwner? I think it was fixed in the "JobOwner" cmdlets you wrote, but not here, so I can probably just fix it with code copied or inspired from what you've written elsewhere.

from dbatools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.