Process Explorer aka procexp, is a amazingly helpful little peace of standalone code. There have been so many scenarios that I would not have survived without it but now that I need to blog about it I realise theirs just to much to cover all of it without making it look like a one dimensional tool.
So I will just cover the basics, read more at:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Introduction
Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
Its display consists of two sub-windows.
The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that Process Explorer is in.
If it is in handle mode,
you'll see the handles that the process selected in the top window has opened.
If it is in DLL mode,
you'll see the DLLs and memory-mapped files that the process has loaded.
Process Explorer has everything from a powerful search capability that will quickly show you which processes have particular handles opened or DLLs loaded to the useful unique capabilities such as tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.
Ever wondered which program has a particular file or directory open or what sits behind a particular window or application? With Process Explorer you can now find out.
Download
Run Process Explorer now from Live.Sysinternals.com
Runs on:
Client: Windows XP and higher (Including IA64).
Server: Windows Server 2003 and higher (Including IA64).
Installation
Simply run Process Explorer (procexp.exe).
The help file describes Process Explorer operation and usage. If you have problems or questions please visit the Sysinternals Process Explorer Forum.
Wednesday, March 27, 2013
Sunday, March 17, 2013
Google Calendar - Repeating an event on the last of the month
I regularly attend Information Worker gatherings which occur on the last Thursday of every month.
I added a repeating Google calendar entry a wile back only to realise that in some months there were 5 Thursdays instead of 4 and my calendar event was actually set to repeat "Monthly on the fourth Thursday" and for the life of me I could not figure out how to change this.
I added a repeating Google calendar entry a wile back only to realise that in some months there were 5 Thursdays instead of 4 and my calendar event was actually set to repeat "Monthly on the fourth Thursday" and for the life of me I could not figure out how to change this.
After some frustration I manage to find the following ways of doing it.
Add the entry on an appropriate month, one with 5 Thursdays in my case.
A fairly easy way is to find a month that actually has 5 Thursdays and make the event start from there. This will set the recurrence to repeat "Monthly on the last Thursday", instead of "Monthly on the fourth Thursday".
Add the entry in the main calendar view using simple English.
The simplest way I found is to just write out the entire event in plain English as a single line of text using 'at' and 'on'.
For example:
This will create an event called "Information Worker Cape Town Community Night", with the 'Where' field set to Park 3, Engen House, Raapenberg Road, Mowbray, 7925" and the repetition set to "Monthly on the last Thursday".
Hack the ICS
This solution is probably the hardest, but because the ICalendar format does support this, you could write the code manually. To do this you would have to export the calendar to a file, hack it and import it back.
NOTE: If you're re-importing events from the same Google Calendar, do not delete the events in your calendar first. Simply import the file, which will make the necessary updates. Deleting all the events will cause you to not be able to import your file.
While it's nice to know this, seems like more effort than just typing what you want in English right?
A better way...
Perhaps Google can provide us with an additional option in the repeat popup to allow for this.
Or maybe the IW organisers should maintain there own calendar feed that we could all subscribe to. This would also mean that if a particular meeting gets moved or cancelled, all the subscribers calendars would automatically be updated!
- Add the entry on an appropriate month, one with 5 Thursdays in my case.
- Add the entry in the main calendar view using simple English.
- Hack the ICS
- A better way...
Add the entry on an appropriate month, one with 5 Thursdays in my case.
A fairly easy way is to find a month that actually has 5 Thursdays and make the event start from there. This will set the recurrence to repeat "Monthly on the last Thursday", instead of "Monthly on the fourth Thursday".
Add the entry in the main calendar view using simple English.
The simplest way I found is to just write out the entire event in plain English as a single line of text using 'at' and 'on'.
For example:
Information Worker Cape Town Community Night at Golf Park 3, Engen House, Raapenberg Road, Mowbray, 7925 on the last Thursday of every month
This will create an event called "Information Worker Cape Town Community Night", with the 'Where' field set to Park 3, Engen House, Raapenberg Road, Mowbray, 7925" and the repetition set to "Monthly on the last Thursday".
Hack the ICS
This solution is probably the hardest, but because the ICalendar format does support this, you could write the code manually. To do this you would have to export the calendar to a file, hack it and import it back.
NOTE: If you're re-importing events from the same Google Calendar, do not delete the events in your calendar first. Simply import the file, which will make the necessary updates. Deleting all the events will cause you to not be able to import your file.
While it's nice to know this, seems like more effort than just typing what you want in English right?
A better way...
Perhaps Google can provide us with an additional option in the repeat popup to allow for this.
Or maybe the IW organisers should maintain there own calendar feed that we could all subscribe to. This would also mean that if a particular meeting gets moved or cancelled, all the subscribers calendars would automatically be updated!
Thursday, March 7, 2013
Impersonation
Impersonation, a feature that was added in Windows SharePoint Services 3.0, enables you to perform actions on behalf of another user. Impersonation is useful in scenarios such as timer operations that need to update something asynchronously on behalf of a user or to run a high privilege code for a low privilege user.
You can either RunWithElevatedPrivileges to impersonate the System Account or by passing an User Token to the SPSite object to impersonate a specific user.
Note:
This is not to be used to perform long running processes as user tokens usually expire after approximately 24 hours.
RunWithElevatedPrivileges (impersonate the System Account)
Passing User Token (impersonate a specific user)
Get site context using the system account.
Then get the user token of the user you want to impersonate.
Finally use this to open a new SPSite using this users token.
Note:
Impersonation requires two-way trust and will not be available if the Web front-end that interacts with the SharePoint database sits on a server that is located between two other networks as in such scenarios the Web front-end server has only one-way trust.
You can either RunWithElevatedPrivileges to impersonate the System Account or by passing an User Token to the SPSite object to impersonate a specific user.
Note:
This is not to be used to perform long running processes as user tokens usually expire after approximately 24 hours.
RunWithElevatedPrivileges (impersonate the System Account)
SPSecurity.RunWithElevatedPrivileges(() => { // Your code here });
Passing User Token (impersonate a specific user)
Get site context using the system account.
Then get the user token of the user you want to impersonate.
Finally use this to open a new SPSite using this users token.
SPUserToken userToken = tmpWeb.AllUsers[someUser].UserToken; using (SPSite site = new SPSite(url, userToken)) { using (SPWeb web = site.OpenWeb()) { // Your code here } }
Note:
Impersonation requires two-way trust and will not be available if the Web front-end that interacts with the SharePoint database sits on a server that is located between two other networks as in such scenarios the Web front-end server has only one-way trust.
Subscribe to:
Posts (Atom)