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

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

Changing permissions on a named pipe.

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :.NET Framework

Hi all,

I am trying to interface a Web Service Client with a Server program where
communication is achieved via Named Pipes.  My difficulty is that the
Web Service runs under the "NETWORK SERVICE" system account and the Server
runs under another local account with administrator privilege.  I am trying
to introduce code in the server that grants write access to the pipe to the
"NETWORK SERVICE" account.  I assumed that the following would work:

PipeSecurity pipesec = pipeServer.GetAccessControl();

Unfortunately in this sequence, the call to SetAccessControl produces the
an exception (see below).  I have verified that the routines GetAccessControl
and SetAccessControl can successfully be called in sequence, but, of course,
this is of little utility without the intervening AddAccessRule.

Here is a listing of the sample program.

More Related Resource Links

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. 

Changing File Permissions of Disconnected MDF/LDF Files

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.

Changing the caption on a named set member

I have created a named set that is made up of multiple other sets.  These represent dates: (Current Day, Prior Day, Prior Month and Prior Year).  I would like for each set member to have the names above instead of the member names associated with the actual members.  So, instead of member captions of '2/2/2010', '2/1/2010', etc, I'd like the set to return the captions as 'Curr Day", "Prior Day", "Prior Month", "Prior year"). I know that normally, you can't rename members, but I am hoping I can rename the captions on the individual sets that make up my 'rollup set'.  Here's how the sets look: dynamic set [Today] as filter([Process Date].[Process Dates].[Process Date], [Process Date].[Process Dates].properties("Is Current Date")="Y"),caption='Curr Day' dynamic set [Yesterday] as [Today].item(0).PrevMember,caption='Prior Day' dynamic set [Prior ME] as [Today].item(0).Parent.PrevMember,CAPTION='Prior ME' dynamic set [Prior YE] as [Today].item(0).Parent.Parent.Parent.PrevMember,caption='Prior YE' dynamic set [Period Comparison Dates] as [Prior YE] + [Prior ME] + [Yesterday] + [Current Process Date] This works great but the member names are the actual dates, not the "Period comparison" labels I'd like to have.  As you can see, I

Send/open timeouts on WAS-hosted WCF service with named pipe orTCP binding, per-call instancing

We have a client that sends requests to a per-call WCF service (WAS hosted, NP binding, same machine) in a loop. The WCF service calls an external EXE to process requests. The operations on the service can take a few seconds, or a few hours. To combat this, we have sendTimeout=00:05:00, receiveTimeout=00:05:00 and a built-in circuit-breaker on the service that kills the external process after 00:05:00. Any service-side errors are returned to the client as FaultExceptions.  On the client, FaultExceptions are logged and the client proxy is aborted (proxy.Abort()). The client has configurable multithreading. In this example, it is running 3 threads, each of which creates a proxy, makes a call, and closes the proxy (or aborts it if an exception was received). Since the service is instanced as per-call, and it never receives more than 3 simultaneous calls (each of which being followed by a .Close() or .Abort() on the proxy), I would not expect the client to be getting timeouts during the send, but I am. In fact, the send timeouts I am receiving would seem to imply that the WCF service is hitting the default session limit, even though the class is explicitly marked with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]. I put some trace logging on the client and I can see that the timeout is occurring when the proxy is being created. sendTimeout seems to

WCF named pipe ipc has poor performance


I created a couple of simple test client/server applications and use NetNamedPipeBinding to call a single remote function in a loop. No matter what I changed I could not get better than a 1ms round trip time for the function call. However if I run the client application with the Visual Studio 2010 profiler the function call executes 10 times faster and I get 0.1 ms round trip times for the function call.

I'm guessing this has to do with thread scheduling and that the profiler starts a high resolution timer that improves performance. I tried stating a MM timer, timeBeginEvent(1), and that helped slightly, however it is not possible to specify a time below 1ms. Is there any way for an application to emulate the effect of running under the profiler itself to boost WCF performance?




Named Pipe on SQL Server 2005 Cluster


HI All,

We usually disable Named Pipe for all SQL instances. Recently we built a 4 node SQL cluter with 3 instances running on it. Can i disable Named Pipe for SQL instances in a clsutered environemt? is there any impact ?


Permissions needed on Named Sets?


Hello All.

I have a simple cube deployed and I just now added a named set using the TopCount functin as follows:


AS TopCount([Publisher].[Publisher Initials].Members, 10,[Measures].[Ad Rate]),

DISPLAY_FOLDER = 'Top Performers';

After processing, I can see and use the new Named Set in both the BIDS Cube Browser and in Excel, but another user cannot even see it. I have Administrator rights on the Analysis Server, he is simpl

Navigation items disappear after changing permissions


I have a site collection with multiple sub-sites. I have created a group on one of the sub-sites which has full control over the sub-site. I add my self to this group then remove all the additional groups from the site permissions, so that only the group with full control is left. After doing this the site is no longer visible in the Navigation bar of the parent site. However I can still have access to the sub-site if I enter its URL.


Can anyone explain why this is happening and how I can get the link to the site to show again in the navigation bar of the parent site?

Problem with named pipe server in C# and client in native C++ (ACCESS_DENIED)



I'm trying to use IPC between a server application in C# and client application in native C++.

The IPC is "named pipes".

The OS is Windows 7.

It works just fine with C# server and C# client.

It works fine with native C++ server and native C++ client.

However, the native C++ client refuses to connect to same C# server. The error code is 5 (ERROR_ACCESS_DENIED).

Both security descriptors are NULL.

Does anyone here uses such combination or can shed some light on this issues?




Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

A better way to reference your wizard steps using named steps

Note: this article uses the plain vanilla but the concepts apply equally well to its popular counterpart .

By far the most common way that I see wizard steps reference in code snippets is by their index.

.NET 3.5 Adds Named Pipes Support

you want a named pipe server, all you have to do is create some instances of NamedPipeServerStream to handle each client connection. I stole the following code straight from the MSDN documentation.

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

Problem with changing language using culture info


I'm using the following msdn article to use different languages in my web application:


I'm following the instructions step by step in VS 2010, and it creates the resource files exactly how it's supposed to. 

However, when I run the program it just doesn't apply it. I don't see the different values from the resource file. 

If I leave my resource file name as sample.aspx.resx, it works. But when I change it to sample.aspx.en-us.resx, it doesn't work. I'm supplying culture from the aspx page's Culter and UICulture properties. I'm being very careful in choosing the correct file name, as that could be the issue,  but it just doesn't work. I also tried changing the culture in the backend code this way:

Changing direction of pop-ups/alerts in RTL


Hello All,

I am not able to change the direction of popups/Alerts in Arabic culture which should be RTL direction.

Rest of my application is changed in above culture, only problem is with popups and alerts.

Thanks in advance.

Changing from Local to WCF


I've been handed an application thats connection string implies a local host connection.

I want to make this connection a remote connection, to a database located on a Server.  I want the client and server to be able to communicate with one another remotely, instead of a local connection.

How does one create the Data Service, and establish end points to Server and Client?  Is it as simple as creating a contract (which I have limited knowledge on constructing), between the two locations, setting up the dataservice, security, and ratifying the 'connetions'?

A smidge of insight, please ;-)

Required permissions cannot be acquired when host asp.net 3.5 application in godaddy


I got the following error when click print report button.

Application : asp.net 3.5

Crystal report : 10.5

Host: godaddy

Please help me.


Required permissions cannot be acquired.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
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