web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

PowerShell Script to Lock, Unlock Object(s)

(0) ShareShare
ReportReport
Posted on by 22

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

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    No standard powershell command available to lock and Unlock as of now

    the available commands are

    msdn.microsoft.com/.../jj672916(v=nav.80).aspx

  • Suggested answer
    Kirill Cheremisin Profile Picture
    48 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans