A customer has requested whether it was possible to restore a OneDrive site that had been deleted when the user’s account was marked for deletion in AD. After a bit of research, I was able to restore the site back and retrieved the files (luckily it was deleted less than 30 days ago).
Handy lines for adding linked servers in your SQL farm:
exec sp_addlinkedserver @server = ‘SQLSERVERNAME’, @srvproduct = N”, @provider=N’SQLNCLI’, @datasrc = ‘SERVERNAME’
exec sp_addlinkedsrvlogin @rmtsrvname = ‘SQLSERVERNAME’, @useself = ‘false’, @locallogin = ‘login_svc’, @rmtuser = ‘user_svc’, @rmtpassword = ‘********’
Here’s a handy user defined function to split string into comma separated line:
/****** Object: UserDefinedFunction [dbo].[ufnSplitString] Script Date: 19/11/2015 11:18:20 AM ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE FUNCTION [dbo].[ufnSplitString](
@Column int = 1
These are some of the commonly used SQL queries at work, just to note them down for easier access:
When using ORM, should always keep in mind that only one object scope is used. The example came with the package doesn’t really explain this well. Should always declare a page_init call which declares the object scope and store it in session and try to keep using it for any business operations:
Ever wanted to create a gradient image dynamically? This can easily be done using C# with the following snipplet of code. We can also specify the width, height, gradient direction (horizontal or vertical), and the two colors.
The following script will handle the touch and click event in iOS newly updated safari:
Just this week, I accidentally found out that users were able to access Site Settings page, with some sections open out publicly accessible, for example the Regional Settings column! This raise a security threat as we don’t want users to be able to touch these settings. After much digging, I realised it’s because one custom permission that was created for the users have “Browser Directories” permission checked. Once this is unchecked, then they are denied from accessing the setting page.
Infopath has the ability connect to an external data source for data. The problem is there’s not a lot of information available on the net in guiding you to do this. You will most likely bump into problem when publishing the form to run on browser, to your production server where there’s multi-tier architecture (i.e. having multiple servers).
A lot of times, organisations have custom attributes in their Active Directory user profile. However, by default the user profile sync happening between Sharepoint and AD does not include these custom properties, such as EmployeeID. Hence, we can’t retrieve these properties in Infopath.