Best way to share information between different instances of a web part

Hello,
I'm developing a web part that will make changes to a A.D. OU. I don't want to grant the application user rights to the OU and I would like to store the information inside the web part, but dynamically, something like:
static string username="";
static string password = "";
static string OU = "";
So, when the web part find these strings empty ( for ex after IIS restart) , it would ask for username/password and store them at the static strings. Someone (the administrator?) would fetch the page (with the webpart) and fill the strings. The next user
that will come to the page, he shouldn't  be asked for filling up the username/password.
So, I need to share information between instances of the same web part. Can it be done with static variables? Is there any other better solution?
Will this work with the same web part in 2-3-4 pages?
Thank you
Christos

Hi Xristosk,
From a security perspective and also in the interest of making the solution more robust (e.g. I don't think the admin is going to be too happy if he needs to enter in a username/password pair each time an IISReset happens, or the web server dies) what I'd
suggest (and typically do) is to separate the request from the actual performing of the work.
E.g. Keep the username/password pairs out of the web part configuration completely, and instead just make the web part be a form that submits to a list (or db) for the required change. 
Then you can have a separate process (e.g. timer job or windows scheduled task) that has permission to read from the SharePoint list, and also has permission to write into the AD OU.  In terms of storing usernames/passwords - typically you'll want to
avoid doing this.  If you have to then you can consider the Secure Store Service (preferred).  What I'd be most inclined to do is not store any password at all, and instead make sure that the account that the timer job or the scheduled task runs
as has appropriate permission to write into AD.
To answer the last part of your request, because the actual request is separated from the 'doing of the work' then this approach will work fine with 1,2,3,4, n pages.
HTH
-Michael.
Please remember to mark your question as answered and vote it helpful if this solves or helps with your problem. *******************************************************************************************************

Similar Messages

  • [vmware] Best way to share files between host and client

    Good afternoon!
    I have successfully installed VMware server on my machine and set up a virtual machine, powering Windows XP for study issues (emulation via wine does not do the trick for me). The virtual machine runs fast and stable but does not meet my requirements unless I have two issues faced:
    First:
    How to access a USB pendrive monunted by the host system properly within the client?
    Second:
    What is the best way to share file system space between host and client? Should I set up a Samba share which is accessible for both host and client or is it save to grant my VM access to my physical hard disc as a whole (using it as a partition)?
    Thanks for answers in advance, I have still quite a lot to learn, when it comes to VMs.
    Regards,
    ~cg

    Do not setup your VMware to be able to access your physical disk as a whole. This would have you mounting the filesystem twice, corrupting it in the process.
    You /can/ setup VMware with Sharing Folders that lets you share your filesystem (either / or just /home or something else) and that is what I would recommend.
    As for accessing the pen drive from both operating systems at once, I'd say use the same Sharing Folders method. I always share /mnt so that I can access my cdrom/USB/etc from the vmware OS.
    The sharing folders is basically the same as a samba share, but uses vmware's own method (HGFS). Samba is more secure (if you are worried about your VMware OS breaking from it's shell and attacking your real filesystem, which is unlikely). You need the vmware tools installed to make use of it.

  • What is the best way to share calendars between Macs?

    I have two macintosh computers in my house and I use one as the master for our family calendar in ical. I want both calendars in sync, with the second mac as the "copy"-no new data is added here.
    My current method of "sharing" was to publish the files up to our web-server (not apple's) and then subscribe from computer #2 pointing to that web-server.
    Calendar-Publish-choose private server-and fill in the blanks-click-OK.
    When my mac updated to 10.5.4, this method broke. I can no longer publish the files using ical, but I now have to FTP the files up to the web-server. This is a couple of extra steps that is becoming a headache.
    File-Export (about 8 calendar files); open a terminal window; FTP the files up. Go to the other mac and Calendar-refresh all.
    Is there a better way to share ical files between two macs in the same house without FTP-ing? Or is Apple going to fix this problem?

    I set up ical synching through a google calendar and it works well. The benefit here is that you can see your calendar from a web browser when away from the house.
    Info in this thread: http://discussions.apple.com/thread.jspa?messageID=7772872&#7772872
    iCal should have a "share" option like itunes libraries for lans though. Odd that it doesn't.

  • Best way to share contacts between four different people w/ iphone?

    I need to know how you can share contacts with your iPhone between three other people from different cities.

    Google, iCloud, or any other cloud service that allows contact syncing.

  • What's the best way to share media between iTunes libraries?

    I just got my wife her own MacBook, and we definitely want to share media. I know she can set up her own itunes account and we can HomeShare but I am not sure if this is better for some reason than just logging her in with my itunes account. Is it better to separate the mac accounts like this? Put another way, will the macs get 'confused' by having 2 computers driving the same itunes?

    Hi,
    If you share your media, it is probably best to have just the one Apple ID. If you are using home sharing, you use the same Apple ID. You can use more than one computer with the same Apple ID.
    http://support.apple.com/kb/ht3819
    Jim

  • Best way to share files between users?

    New to the Mac World and trying to set things up for all our users. We have 5 (2adults,3kids) and I'm keen to be able to share some files with other members of my family and would like to know the easiest way in doing this.
    A couple of things to note;
    - The two adults are the admin's
    - Would like to share some photos between users (family photos are usually organised by my wife so I don't get to see them)
    - I'd like to let my kids view some of my videos that I've downloaded but not all of them
    Appreciate your time guys!
    Cheers

    Please try this first.  If you want to share certain files between users like pictures or music or even documents, apple has provided an easy way to do so.  The first step is to decide what to share.  For this example I will do pictures.  Open up Finder and go to the Macintosh HD, then click on "Users".  Here you will see a list of the users. Your account will look like a house instead of a folder because it is the account in use.  Click on your account and then right click (secondary click) on the pictures folder. 
    NOTE: From this point on you can do the same thing to any folder, such as music, documents, etc. or any file, such as a specific document in your documents folder.  But I will keep explaining pictures.
    After right clicking on the pictures folder, a new window will open up.  Near the bottom you will see "Sharing & Permissions:"  This is where you decide which users can access your folders/files and whether they can just read them or read and write them.  For example, if you want your wife and kids to have access to your iphoto library, just press the "+" button and add each one of them.  Under "Privilege" you had better give your wife the ability to "Read & Write" or you may get in trouble .  By doing this, any pictures she adds, deletes, or edits will be added, deleted, or edited in your iphoto too (and vice versa).  Lets say you don't want your kids to have editing abilities, then you just give them the "Read Only" privilege.  They can look at all the pictures, but they cannot change, add, or delete them.
    When your wife opens iPhoto for the first time, it will ask which library she wants to use.  (If not, you can do it through the menu bar).  Make sure you choose the iPhoto library under YOUR user account, not your wife's (it's empty).  It will no longer have a little red minus sign next to it.  That is the last time it will ask.  Every time your wife opens her iPhoto, it will use that library.  Same for the kiddos. 
    Again, you can do this with any folder or file.  This is how Apple intended users to share content without duplicating files or using external hard drives.  This way each user has their own icloud account but can access the families shared content.
    Hope this helps!  Good luck!

  • Best way to share files between computers?

    Hi,
    I have a MBP & a G5 and I am doing video editing with FCP & web-designing with
    Dreamweaver on both of the computers. The problem is that I have been using
    the two computers completely separate.
    For example, if I create a project on my laptop, I can't go to my desktop and continue it
    unless I copy the files to a zip drive (or something similar) and manually transfer the files.
    And then I don't know which files are actually up to date.
    Is there any simple way that I can have the two computers produce, access & share files easier?
    I do have a .mac account but I don't know much about it's capabilities?
    I could really use some help and advise here.
    Thanx,
    Todd

    Hi,
    I had the exact same question/ problem a couple of days ago. I think in your case, working with large video files, .mac might not be an option.
    I would say you either work of an external drive (maybe connected as a shared drive wirelessly) as it was suggested to me, or you use a file sync utility like ChronoSync to keep both machines mirrored.
    Hope this helps.

  • What is the best way to share docs

    Seeing as an entire document package can have gigs of data, what might be the best way to share files between two computers running FCP? Would it work to put all media and files on a network drive and then edit the docs from there?
    thanks

    Hi -
    When you say "document package", do you mean "Project"?
    Thanks
    Message was edited by: Meg The Dog

  • What is the best way to share a iTunes library between 5 users on the same computer?

    What is the best way to share a iTunes library between 5 users on the same computer?
    Currently I have a common itunes library in a shared folder that each user is linked to.  The problem is that when one user adds music to the shared file, it does not automaticaly appear to other users when they open their iTunes.  They have to go to the shared library and select the new music in order to make it visable in their iTunes.
    Would iTunes file shareing fix this problem?
    Thanks

    aapl.up wrote:
    Rick, are you saying that if you try to share a folder outside of home and use sharepoints, then the other mac wont prompt you to log in? Have you tried that? It is hard to believe that is the case
    I am sort of saying that. Have you tried it? I know it's hard to believe, but you really need to help us out by trying some steps that you don't believe.
    We can't see what your exact situation is. We sort of know what's worked for us out here. Just trying to help you get this going in less than 24 hours!
    Sharepoints manages the samba configuration file. It's free software that puts a pretty face on an otherwise cumbersome config file.
    Give it a shot.
    windows will not prompt for passwords, I have tried this with multiple computer at home for both vista and xp
    As I stated. You will not get prompted on windows, if you have set up sharing in an insecure fashion. You are not using a secured sharing situation.
    No argument with your statement.

  • HT3819 How do I share music between different users on the same computer?

    I understand Home Sharing helps me share music across different computers.  How do I share between different users on the same computer?  We have a few instances of iTunes on a single computer and have to download from the same CD each time.  I must be doing something wrong - seems crazy to have several copies of the same song on one hard-drive when Home Share allows for sharing across computers - how do I share within the same computer?  Please outline specific steps.  THANKS.

    Hello Whigged-out,
    It sounds like you would like to share one library between two different users on your iMac.  I found an article with steps you can take to accomplish this:
    iTunes: How to share music between different accounts on a single computer
    http://support.apple.com/kb/ht1203
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • HT1203 iTunes: How to share music between different accounts on a single computer - I tried to use the instructions to configure 2 different windows users sharing the same iTunes library.  I could not get this to work per the instructions.

    I tried to configure 2 windows users accounts using a single library per the instructions in HT1203.  My iTunes library is on an external drive.  I cannot get this to work.  Any suggestions?

    To give other users read-only access to your iTunes library, use the Sharing features of iTunes. Sharing works over the local network as well as on the same computer. See the built-in help for details.
    If you want to give full read/write access to more than one user, see the support article linked below.
    iTunes: How to share music between different accounts on a single computer
    There is a way to share the library without moving it to a secondary volume. If you really need to do that, ask for instructions.

  • HT3819 what is the best way to share music from my home computers with sonos?

    I have 2 iMacs and a Macbook Pro, all with different music in iTunes. What is the best way to share all the music with Sonos? Home sharing or Music sharing?

    http://www.networkworld.com/reviews/2009/080709-review-5-usb-turntables-convert. html
    http://vinyl-converter-turntable-review.toptenreviews.com/
    I've always been partial to Numark and Audio-Technica. Have several DJ friends and a client who runs a DJ business, and they use Audio-Technica stuff almost exclusively.
    You may be surprised at how easy it is...
    With the exception of cameras (webcams especially) Macs are pretty much "Plug &Play" with anything USB, and even though I've never used one, reviews say you just plug the turntable in and it reads as a drive.

  • Does anyone know if there is a way to share files between Mavericks and Mac OS 9.1 operating system?

    Does anyone know if there is a way to share files between Mavericks and Mac OS 9.1 operating system? When I try to connect from my iMac I get a window that says "The version of the server you are trying to connect to is not supported." Is there a work-around to this problem or is it just not possible? It would be largly appriciated for a solutin beings my business is a small town newspaper, and we have some important files on the older computer that need to be acessed daily.

    Actually to share files between OS 8-9 and OS X, all versions, is quite easy from what I read. Look here for some details.
    http://reviews.cnet.com/8301-13727_7-20003464-263.html
    And here.
    https://www.google.com/search?q=file+sharing+Mac+OS+9.x&oq=file+sharing+Mac+OS+9 .x&aqs=chrome..69i57.20706j0j1&sourceid=chrome&ie=UTF-8
    Or since both OS 9 and OS X can do SMB Windows sharing you could use that protocol to share files from one to the other.
    Doesn't really matter what OS you are using. Mac OS/OS X shar files with Windows computers of all types and versions of Windows so the same applies for the different versions of Mac OS/OS X.
    Each Operating System takes care of reading and writing files to there respective file formats of the hard drives so that does not have to be the same. They both just have to be able to do Ethernet with the same files sharing protocol.

  • Best way to share a video with someone in another city...

    What is the best way to share a video with someone in another city?
    I know that FCPX contains all sorts of share options which create different resolutions and file sizes appropriate for different sites like YouTube, Facebook, and others.  But how to create the videos really isn't the problem.
    I want to know how to share them.  I'm creating videos that are ultimately to be viewed on the internet.  When I have a completed video, I want to show it to the person who it is for before I finalize it.  I know that if it very small, I could email it.  And if it's larger, I could use something like Dropbox.  But I don't necessarily want them to have a copy of it (though I could do that and put a watermark on it).
    I'd like to upload it to a site like YouTube or Vimeo, but those sites seem to be about sharing videos with a wide audience.  I know you can make a video private on YouTube, but, from what I've read, they permanently have the right to use the content, which I definitely don't want.
    So what's the best way to do this?  I'm going to have to do it regularly, so I'm willing to pay for a service if it assures privacy and does not try to assert some right to my content.
    I know there is an issue to be considered with people screen capturing content, but I'll use a watermark to lessen the chances of that.

    Hi Russ--
    I'll have to read through Vimeo's terms of service, but I have to think they're asserting some right to the content like YouTube does.
    Plus, these are commercial videos, and I don't think they allow that.  Of course, if they're private, I'm obviously not trying to sell anything.  But I have to think that it somehow is against their TOS since me posting a bunch of private videos that nobody can see really doesn't do them any good at all.

  • How to share memory between different VMs?

    Hi, dear all!
    I don't know if it is possible to share memory between different VMs. I know its easy for threads. Now my problem is that I want to start serveral applications which share only one copy of data, I don't know what's the right way to do that.
    Thanx

    They are some volume data for visualization. I want to
    serveral rendering servers on a single machine, the
    data size can be up to 1024*1024*1024 ( or even larger
    I don't know if I HAVE TO use threads in order to
    share the data, however, threads are not preemptive as
    processes I think, is that true?
    Not really sure what that has to do with it.
    I believe the VMs for most common OSes use preemptive thread scheduling. I know windows does and I am rather certain that solaris/linux also do that.
    A number of suggestions were made above for your problem. Memory mapped files allow multiple VMs if memory mapped files work for your VM/OS. Or you can use a single VM.
    Given that your dataset is 1 gig or larger you might want to keep in mind the limitations of modern OSes. Windows for example will not normally allow any application to have a process space larger than 2 gigs. And on all OSes the VM heap limitations for 32-bit VMs are below 2 gigs by several hundred mega-bytes.

Maybe you are looking for