.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Changing File Permissions of Disconnected MDF/LDF Files

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :Sql Server
I am a university professor and have over a hundred student project databases using the developer edition of SQL 2005 and 2008 on a portable hard drive.  All are disconnected from any server.  I need to move these to a new hard drive but no file system tool I can find will let me copy the .mdf or .ldf files.  Each of these files has a single user with permissions and the user is a long alpha/numeric string that seems to have been generated by SQL.  I can copy these files if I select each file individually and give full control permissions to my current login.  On some files I need to first take ownership.  I just don't want to have to go in and do this manually for 200+ files scattered all over the drive. I really need some sort of batch approach (including something that can be launched from within VB which I can use to navigate my drive's folder structure looking for .mdf/.ldf files) to let me change the permissions on these files.  As I said, I have a LOT of them and they are scattered around a deep folder structure organized by semester, course, project team, and sometimes project version.  Further, the files accompany other files such as VB projects, report projects, SSIS projects, etc.  I have access to Windows Vista and Windows 7 for doing this.

View Complete Post

More Related Resource Links

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Access Control: Understanding Windows File And Registry Permissions


Understanding the ACLs that govern permissions and rights before an operation is allowed to proceed is critical to enhancing security.

John R. Michener

MSDN Magazine November 2008

Code Name WinFS: Revolutionary File Storage System Lets Users Search and Manage Files Based on Conte


One of the monumental problems organizations face today is aggregating information that's stored in disparate formats. Knowledge workers have long wanted to be able to search for content independent of format. The next version of the Windows operating system, code-named "Longhorn," boasts a new storage subsystem that makes that task easier. That subsystem, code-named "WinFS," allows the user to perform searches based on the metadata of the stored item, regardless of what type of file it is or which application created it. This article covers the basic architecture of WinFS and explains how to use the WinFS managed API.

Richard Grimes

MSDN Magazine January 2004

Reg File Upload control to upload files from document library


In Field Upload control if we click browse button it allow us to search file in our hard disk but now as per my requirement as soon as user clicks ‘Browse’ button it should point to the document libraries and their files in site.Let me know how could i achieve this?

Thanks & Regards,


why only one file is grew two times by 10 % after all files are filld

hi, i have one data file group DATA,With 8 files associated with this.... two files in each four disk drive. i am setting the initial size of each file 1mb and auto grow by 10 % unrestricted. till 75 gb it works fine data in all the files are evenly distributed but once it reaches to 75 GB only one of those files is increasing two times rest of the files remains same... like (75*1.1)*1.1 others are 75 GB.. i expect it should increase first file by 10 % fill it and then pick second file expand by 10 % and fill and so on..  what could be the reason?? can any one help me on this??/

Changing default permissions for Owners group

When a site is created within SharePoint (and permissions are not inherited from the parent), a default Owners, Members and Visitors group is created.  The default Owners group is assigned "Full Control".  I want this to default to a custom permission level that I have created called "Full Control - Limited".  What changes do I need to make to ensure that all new Owner groups are automatically assigned this custom permission level and NOT "Full Control"? EDIT - I have a console application which sweeps through all of the sites and changes all "Full Control" to "Full Control - Limited" but I really don't want to set a Scheduled Task each night to fix the new groups. 

WPF Desktop App - Write file permissions

I have been working on a WPF desktop app for a while now, and I am struggling to deploy it.  The problem seems to be that the app does not have permissions to save the file I am creating.  Although I should say the code works fine running locally through Visual Studio. I am OneClick deploying the app, and just want to give it full access although just knowing how to give it write permission is all I need.  The app is only to be used by a few members of staff on our intranet, so trust is not really an issue here. If anyone can point me in the direction of a quick solution that would be great, and you'll save me alot of time trying to figure out all the documentation which I am failing to work out what to do with so far. Additional info: I am deploying over a web address, which I think means Internet Zone. Thanks John

File not found error when trying to open site permissions on a blog site

We have created a simple team site and a block subsite.  When trying to edit the site permissions we see the following error.  Any ideas? When opening a blog site and clicking Site Actions - site permissions we received a new page with the following error: Error File Not Found Troubleshoot issue with Microsoft Sharepoint Foundation Correlation ID: 51b54786-f344-4474-b88e-3080c363693 Date and Time: 3/24/2010 3:03:38 PM

Error when modifying permissions on Itemadded for a file upload

All, I have registered an eventhandler for a document library. On ItemAdded, I want to modify the permissions of the item such that only the uploader(creator) should have access to the file he is uploading. When I upload a file and fill in the required metadata and click on Save, I get the error"The file SubmissionForReview_Draft/Untitled.htm has been modified by SHAREPOINT\system " . But, I did verify the event fired and all appropriate permissions are set. The only explanation for this could be, the file gets uploaded, the event fired and the properties of the file has changed and then the form to add additional metadata has poped up. On clicking on save, SharePoint determines that the file for which the metadata has to be added has changed internally and throws error, which may be as expected. Question: Is there a way around this issue, maybe to suppress check on file changed ?   Thanks mano Mano Mangaldas | Blog : http://howtosharepoint.blogspot.com 

what is the better design for location of system database data / log files and user data/log file,

is there a guideline for better performance for system database data location log location, like tempdb location etc. also better location for user databases/data and log.

Modify File Permissions

SQL Server 2005/2008 Ent. When trying to move the database files from one drive to another I get a permission denied error. The process is: ALTER DATABASE db_name SET OFFLINE WITH ROLLBACK AFTER 30 SECONDS (this works) Move files to new drive (this works) ALTER DATABASE db_name MODIFY  FILE ( NAME= logical_name, FILENAME = 'new_path\filename') (This doesn't work*) ALTER DATABASE db_name SET ONLINE (this works) * This exact method is part of an internal application. When the applicaiton is run as a user ('admin') that has: sysadmin role it works as expected. When run as a user ('restricted') that has just: db_creator (instance wide) db_owner (just the one database) db_diskadmin (instance wide) it fails with a user doesn't have alter permissions for the databse ... I have tried:  all of the steps manually as the 'restriced' user to make sure it isn't something wrong with our app. all of the setps manually as the 'admin' user setting the database owner to another acount and explicitly given all permissions to the 'restricted' account From what I have read the databse owner (dbo) user should be able to do any ALTER statement to the databse. And it is able to take the database offline but it can't change the file paths. Is there no other way to do this without giving sysadmin to the application service account?

Dealing with a changing folder value in Foreach File Enumerator

I have a Foreach Loop component that loops through files in a folder.  That folder doesn't exist on the server where I'm going to move the package to.  Within the Foreach Loop Editor, the Enumerator Configuration Folder doesn't appear to be able to take a variable value.  Also, it doesn't appear that there's a "Folder" property in the expressions property list. Is there some way I can use a variable value for this foreach file loop's folder location?  I need to move the package to the dev server and then eventually to the prod server.  I don't mind manually opening the *.dtsx file on each server to change the values accordingly, but I would think there's a better way. Any advice you could offer would be greatly appreciated.  The dev and prod servers have SQL Server 2008 R2 with SSIS 2008 R2 on Windows 2008 Server. Thanks, everybody.

RBS Maintainer not cleanup files in file system (SharePoint 2010)

Here's my environment:   Server #1: SQL Server 2008 R2 Express, RBS enabled Server #2: SharePoint Foundation 2010, RBS installed I setup RBS according to this http://technet.microsoft.com/en-us/library/ee663474.aspx successfully. And I can see the files are storing in NTFS file system instead of database. And then I'm configuring RBS Maintainer according to http://technet.microsoft.com/en-us/library/ff943566.aspx . But it doesn't seem working as expected. I deleted the file from SharePoint Document Library and emptied recycle bin, even in site collection recycle bin. And even I delete the whole site collection. The RBS Maintainer doesn't delete the files in file system. I've updated the following rbs config on my content database for test: exec mssqlrbs.rbs_sp_set_config_value 'garbage_collection_time_window', 'time 00:00:00'; exec mssqlrbs.rbs_sp_set_config_value 'delete_scan_period ', 'time 00:00:00'; exec mssqlrbs.rbs_sp_set_config_value 'orphan_scan_period', 'time 00:00:00'; Maintainer output after I deleted the file, emptied end user recycle bin and site collection recycle bin : C:\Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer>"C:\Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer\Microsoft.Data.SqlRemot eBlobs.Maintainer.exe" -Connect

changing config file after publishing


Is it ok to change the config file after publishing a site?  I use shared hosting.  

It would be nice to do things like change connection strings and smtp settings with out having to republish the site.

How to merge sheets from multiple excel files into one .xls file?


 I have several excel spreadsheet fils, each of them contains multiple work sheets that may storing images or data.

 How could I merge all of these work sheets to just one .xls file and keep their original layout and style using asp.net?

 Thanks in advance.

Code behind file changing


I have a code behind file which has only a few placeholders and literal. The gridview control and others are added in real time according to program conditions. I noticed that once in a while th eprogram stopped working because the .aspx file is changed  and some of the place holders disappeared - Why? (the bolded lines disappeared once in a while)



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DRProWebReport.aspx.cs" Inherits="DRProWeb.DRProWebReport" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Setup file(*.msi) also includes .aspx.cs (source code) files also


My project is recently migrated from 2008 to 2010

actualy we developed project in VS 2005 in that we created setup file but when we migrated to vs2008 setup file giving problem to us.

now when we make setup file it is including .aspx.cs files also but this if we publish our project it wont including source code.

why setup file including .aspx.cs files is there any way to change.

plz replay ASAP

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend