Using the below code I am able to get the list of all signed in users. Is there a way to know which is the current active user?
IReadOnlyList<User> users = await Windows.System.User.FindAllAsync();
I recently ran into this problem myself, and posted about it here. Someone responded there, and gave me some pretty big hints, which in turn helped me to get this solved.
Here is the quick and dirty (my UWP is HTML/JavaScript based BTW):
First, include the WinJS library in your project, if you don't already have it. Then, you just need a little bit of code to grab the active user, when the application is launched...
WinJS.Application.addEventListener('activated', function (args) {
args.detail.user // <-- the active user!!
});
In order for this to be of any use, you need to grant your VS Solution, the "userAccountInformation" capability. To do that:
Open your Visual Studio solution (I am using VS 2015).
Double click your appxmanifest file.
Click the "capabilities" tab.
Check the option titled, "User Account Information".
Related
I am working on Win 10 upgrade activity. As you know we can select application for file extension. So, those file will open on that app. e.g. html files only open in Chrome when user double click on that.
We can create XML file (DefaultAppAssociations.xml) and place it in C:\windows\system32
Now, I got the request to make one application default but let user decide if they want any other app. Is there any way to handle such things because defaultappassociations.xml will hard code this. Every time machine restart and it will set the same.
This is only possible as part of the operating system deployment or rather for newly created user profiles.
The command (official documentation):
Dism.exe /online /Import-DefaultAppAssociations:<path to exported xml>
However as I said you cannot alter existing profiles that way. Altering existing profiles in any way that is not the force via gpo is afaik not possible anymore because Microsoft does not want to allow it. A pretty stupid decision but at least you can tell whoever made the request that it is by MS design.
We have a project administrator for a collection of projects on TFS Online. We recently hired so he had to add the guy as a new member into the team.
However he cannot see one specific project we have, even with identical permissions as the other users. His account was created in the same way as the others.
Trying to help the guy out here I offered to try a few things and noticed, If I create a new project as a test. "Test1", and add him as a member, he can see this account fine when he logs in to TFS Online/Connects on Visual Studio.
Which leads me to believe that it's based on some visibility setting within TFS, even though the other members linked to the project can see it fine.
Any possible ideas for me to try?
You need to try and trace his effective permissions. It sounds like there is a denied somewhere.
If you open the admin for that team project and goto the security tab there is a box to add the users account. You should then see the effective permission on the right and he should have and Alowed in the "View project level information" permission.
If he does bot you can roll your mouse over it and click the "why" button and you will see where the overide is coming from.
I've been playing around with the new "Websites" feature of Azure (which I believe is still in beta), but I've run into a problem. I've got two subscriptions associated with my account - one for personal use, the other for my company. And of course, I'd like to be able to specify which subscription is used when I create a new website. But when I try to create a website, it always picks my second subscription, and never gives me a chance to specify which one I'd like to use. Nor can I figure out how to move the website to a different subscription after I've created it.
I've walked through this several times now, and I can't spot any place where I can specify which subscription to use. Is this just a beta glitch? Or have I missed something?
I ran into the same thing, called MS support. Switch back to the standard portal to make this change.
To get to the old portal hover over the green "preview" button at the top. This doesn't seem to work in Chrome for me, just IE.
Do take a look at my response on MSDN Forums for a similar question there: http://social.msdn.microsoft.com/Forums/en-US/windowsazurepurchasing/thread/d9624b03-1d6c-484a-9fa8-8548c35a9d4f/. Basically you would need to activate this feature for each subscription separately since it is in preview mode.
I'm working under windows Server 2008 :S
with restricted user not administrator.
using Visual Studio 2010
I try to run write this code
ApplicationClass app = new ApplicationClass();
Workbook book = app.Workbooks.Open("");
Worksheet sheet = (Worksheet)book.Worksheets[1];
Picture pict = sheet.Pictures(pictureName) as Picture;
Pictures() method not exist in sheet object !
But
When I try this code under windows 7 with Administrator user
The Picture() method is exist and every thing is OK
I wonder, if there is some thing with interop and windows security ?
If you visit the MSDN page for this, I can see two issues:
http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.worksheet.pictures.aspx
This API supports the Visual Studio infrastructure and is not intended to be used directly from your code.
Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
It seems the reason is indeed a restricted user. Is there a reason you are using this API since documentation suggests that it should not be used directly. Perhaps you are missing a wrapper.
I am currently working on a custom SharePoint web part (WSS 3.0, not MOSS) that will pull in information for all of the users in Active Directory to build an up to date employee directory. This web part shows things like phone number, address, and other similar fields. The issue that I am having is that, by default, the SharePoint web site on IIS is running as the user IUSR_. This user does not have access to Active Directory, so I am unable to retrieve any user information.
To get around this for testing I have hard coded the credentials for a test user which I added just for this purpose. This, obviously, is not ideal. If anyone removes this user or if they ever change the password then the web part will break and they will have no way to fix it (they have no in-house developers to take it over once I am finished here). To fix this problem, I would like to make the Username/Password custom properties on the web part so I can pass those to Active Directory to retrieve the information I need. The issue I am having with this is that the password is stored in plain text so anyone can read it. I would like it to display as ******** or something similar. Is there a way to make a custom property on a web part a password type?
If this isn't possible, can anyone recommend another way to accomplish what I am trying to do? At this time I cannot change the user that the SharePoint website runs as. Although, if I cannot find any other solutions I will try again to persuade them.
Thanks in advance!
We use a service account for that. That service account is solely used for that. Something like DOMAIN\SPS_AD_READ_CUSTOMER
In our documentation that we deliver when putting the application in production that account is put in the list of stuff that is needed to make the webpart run. If the webpart ever fails, the ITPro can go to the chapter and check if everything is still ok.
It's not ideal, but I don't really know another way on how to fix it.
I would go with custom Editor Part, then set up a control of TextBox with property TextBoxMode set to Password, then override methods from type EditorPart - SynchChanges() and ApplyChanges() to set and retrieve values.
tip: override method CreateEditorParts of a WebPart type to start with.