Notifications
Announcements
No record found.
Hi,
In Object Designer, developer can Lock, Unload and Force Unload an object. Can we do this in powerShell script as well.
Thanks,
Manish Sinha
*This post is locked for comments
No standard powershell command available to lock and Unlock as of now
the available commands are
msdn.microsoft.com/.../jj672916(v=nav.80).aspx
Hi Manish!
As Mohana said, there is no standard ps command, but there is a workaround here.
All locks are stored in the table Object. So you can use SQL to get the list or lock/unlock.
Here is an example of getting a dataset with information about locked objects:
$query = "SELECT * FROM [dbo].[Object] WHERE [Locked] = 1" $ds = Invoke-Sqlcmd -Query $query ` -ServerInstance $DBServerName ` -Database $DBName ` -As DataSet
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
HoangNam 7