Today i will explain how to Check all Data file and log file for all your database we will check the Extensions for (MDF , NDF , LDF) by using policy management .
1- Create Conditions
at the first we will create 2 condition one for Data file and the other for Log file
I- Data File Extensions Condition
Open SQL Server Management studio >>> Mangment >>> Policy Mangment >>> Conditions >>>> Right Click on it >>> New Condition
Name : Data File Extensions .
Facet : Data File .
Field : @File name
II – Log File Extensions Conditions :
Open SQL Server Management studio >>> Mangment >>> Policy Mangment >>> Conditions >>>> Right Click on it >>> New Condition
Name : Log File Extensions .
Facet : Data File .
Field : @File name
2- Create policy :
Now we will Create 2 Policy one “Check Data File” and the Other is “Check log File”
I – Policy – Check Data File :
Open SQL Server Management studio >>> Mangment >>> Policy Mangment >>> Policies>>>> Right Click on it >>> New Policy
Name : Check Data File .
Check Condition : Data File Extensions
II – Policy – Check Log File :
Open SQL Server Management studio >>> Mangment >>> Policy Mangment >>> Policies>>>> Right Click on it >>> New Policy
Name : Check Log File .
Check Condition : Log File Extensions
Now after we create the policy if you go to Policies and right click on Policy name ” Check Data File ” >>> Evaluate
After the Evaluate Finish you will find the Data file for your all databases in your SQl Server Instance if you clicked on View you will See the Full path to the MDF and NDF
in my example now i have MDF only no File Extensions With NDF so i have More Cross
I Wish Success To Everyone
Eng. Mostafa Elmasry
Database Administrator