Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Monday, April 30, 2012

SCCM: Script to delete package from database


Many times we come across a scenario where we need to delete a package from SQL database. Below is the script to delete a package entry for the same. 
select* from pkgstatus where id='Package ID' and sitecode='SCCM Site Code'
delete from pkgstatus where id='Package ID' and sitecode='SCCM Site Code'

Sunday, April 29, 2012

Configure MDT Database For Dynamic Naming and OU

The dynamic computer naming process outlined uses integration points and the ability to run something called UserExit scripts which allows for the extension of the MDT inbuilt logic. The UserExit script will dynamically build the computer name. The computer name generated by the UserExit script will be based on a location ID (two or morecharacters added as a custom property in MDT Deployment Database), the computer chassis typed (L for laptop, W for Workstation, V for Virtual and X if the chassis cannot be identified), and the first 7 characters of the computer serial number (removing spaces and replacing them with minus (-) for situations where the serial number contains spaces such as virtual machines serial numbers). These three properties are then glued together and provided as the OSDComputername variable for use in the deployment process so the computer name will look like: UK (location ID) L (Chassis ID) 1234567 (Serial Number ID).

Steps to follow to achieve this.
1) Create a new property in the MDT Deployment Database (for the location ID).
2) To add a custom property to the MDT Deployment Database we need to edit this table.
Open the MDT Deployment Database() using SQL Management Studio and navigate to the dbo.Settings table


Monday, April 23, 2012

Move SQL Server 2008 Express Database

We came across a scenario where we needed to move SQL Express 2008 Database from one computer to another computer. Posting the steps for the same , hope it helps your requirement at some stage!!
A.      Go to SQL Server.  Open SQL Server Management Studio.

B.      Click on New Query and execute the below command.

               Backup Database YourDatabaseName TO Disk='D:\yourbackupfilename.bak'


Azure Policy support for remediating tags for existing resources

Use Azure policy to remediate tags for existing resources. https://azure.microsoft.com/en-us/updates/azure-provides-at-scale-tags-managem...