Pages

Thursday, July 4, 2019

How do I get Current User Login detail from MS power Apps

You can use the Office 365 Users Connector to get this information. 

Current User
Office365Users.MyProfile().Department
Office365Users.MyProfile().DisplayName
Office365Users.MyProfile().GivenName
Office365Users.MyProfile().Id
Office365Users.MyProfile().JobTitle
Office365Users.MyProfile().Mail
Office365Users.MyProfile().MailNickname
Office365Users.MyProfile().Surname
Office365Users.MyProfile().TelephoneNumber
Office365Users.MyProfile().UserPrincipalName
Office365Users.MyProfile().AccountEnabled

To show information about another user:
Office365Users.UserProfile(name@company.com).Department
Office365Users.UserProfile(name@company.com).DisplayName
Office365Users.UserProfile(name@company.com).GivenName
Office365Users.UserProfile(name@company.com).Id
Office365Users.UserProfile(name@company.com).JobTitle
Office365Users.UserProfile(name@company.com).Mail
Office365Users.UserProfile(name@company.com).MailNickname
Office365Users.UserProfile(name@company.com).Surname
Office365Users.UserProfile(name@company.com).TelephoneNumber
Office365Users.UserProfile(name@company.com).UserPrincipalName
Office365Users.UserProfile(name@company.com).AccountEnabled

To show information about another user's manager:Office365Users.Manager(name@company.com).Department
Office365Users.Manager(name@company.com).DisplayName
Office365Users.Manager(name@company.com).GivenName
Office365Users.Manager(name@company.com).Id
Office365Users.Manager(name@company.com).JobTitle
Office365Users.Manager(name@company.com).Mail
Office365Users.Manager(name@company.com).MailNickname
Office365Users.Manager(name@company.com).Surname
Office365Users.Manager(name@company.com).TelephoneNumber
Office365Users.Manager(name@company.com).UserPrincipalName
Office365Users.Manager(name@company.com).AccountEnabled

Thursday, June 6, 2019

Monday, May 27, 2019

Monday, April 15, 2019

Re-Create WSS_Logging Database in the Sharepoint 2013 Server

My WSS_Logging Database is corrupted then I want to create new database.

My Central Admin --> Monitorng --> Configure usage and health data collection settings do point to WSS_Logging too, but this DB is not present.

you can create manually re-create WSS_Logging DB using in the following powershell script.

Looks like it will work. you should first delete Service Application since it already existed, but than you could recreate it + it created database. No complaints in the event log so far.

Try using this PowerShell:

#Configuration Variables
$UsageSAName = "Usage and Health Data Collection Service"
$DatabaseName = "WSS_Logging"
$DatabaseServer="SPSQL Servername\Instance Name"
$UsageLogPath = "C:\UsageLogs\"
 
#Get the Usage Service Application Service Instance
$ServiceInstance = Get-SPUsageService
 
#Create new Usage Service application
New-SPUsageApplication -Name $UsageSAName -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -UsageService $ServiceInstance #> $null
 
#Create Service Application Proxy..." 
$proxy = Get-SPServiceApplicationProxy | where {$_.TypeName -eq "Usage and Health Data Collection Proxy"}
$proxy.Provision()

Friday, March 22, 2019

Shrepoint Page library not created After activated Publishing feature. Unable to create any publishing pages

I have enabled SharePoint server publishing feature in the site, which is a site collection as well. But unfortunately the Pages library list is not appearing and i am unable to create any publishing pages.
Is there a way to solve this. I tried deactivating and activating via manually still i didnt get solution.

Solution:

Kindly find in the powershell script then deactivating and activating using powershell commands.
Finally, It will appear publishing feature and page library lists.

SharePoint Server:
Disable-SPFeature identity 'publishingSite' -URL http://server/ -force
Disable-SPFeature identity 'PublishingResources' -URL http://server/ -force
Disable-SPFeature identity 'Publishing' -URL http://server/ -force
Disable-SPFeature identity 'PublishingLayouts' -URL http://server/ -force
Disable-SPFeature identity 'publishingweb' -URL http://server/ -force

Enable-SPFeature identity 'publishingSite' -URL http://server/ -force
Enable-SPFeature identity 'PublishingResources' -URL http://server/ -force
Enable-SPFeature identity 'Publishing' -URL http://server/ -force
Enable-SPFeature identity 'PublishingLayouts' -URL http://server/ -force
Enable-SPFeature identity 'publishingweb' -URL http://server/ -force
SharePoint Online/PnP-PowerShell:
Disable-SPOFeature Identity "F6924D36-2FA8-4f0b-B16D-06B7250180FA" -Scope Site
Disable-SPOFeature Identity "AEBC918D-B20F-4a11-A1DB-9ED84D79C87E" -Scope Site
Disable-SPOFeature Identity "22A9EF51-737B-4ff2-9346-694633FE4416" -Scope Web
Disable-SPOFeature Identity "D3F51BE2-38A8-4e44-BA84-940D35BE1566" -Scope Site
Disable-SPOFeature Identity "94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB" -Scope Web

Enable-SPOFeature Identity "F6924D36-2FA8-4f0b-B16D-06B7250180FA" -Scope Site
Enable-SPOFeature Identity "AEBC918D-B20F-4a11-A1DB-9ED84D79C87E" -Scope Site
Enable-SPOFeature Identity "22A9EF51-737B-4ff2-9346-694633FE4416" -Scope Web
Enable-SPOFeature Identity "D3F51BE2-38A8-4e44-BA84-940D35BE1566" -Scope Site
Enable-SPOFeature Identity "94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB" -Scope Web

Friday, February 1, 2019

Sharepoint JSOM client object model code to retrieve other list item in Nintex Form

When using the SharePoint JavaScript client object model, your code needs to be broken up into two parts: the first part specifies what you want to get, and involves you loading queries and commands into an SPClientContext object; the second part lets you manipulate the results of the query to SharePoint, and runs as an asynchronous callback of the query execution.
  1. Create your context, specify which lists you want to access, etc.
  2. Run clientContext.executeQueryAsync() (where clientContext is an SP.ClientContextobject), and pass in delegate functions to run on success or failure
  3. In your "onSuccess" delegate function, you can work with the results of the commands you loaded up in step 1



function FormLoading()
{
console.log('Inside Jcode Form Loading Calls');
NWF$("#" + JSLeaveType).change(function()
{

EmpLeaveBalance();
});
}

function  EmployeeLeaveBalance()
{
try
{
NWF$("#" + JSLeaveBalance).val("");
var clientContext = SP.ClientContext.get_current(); 
var web = clientContext.get_web(); 

var oList = clientContext.get_web().get_lists().getByTitle("LeaveSBalanceS");

var newCRUsername = varCRUsername.replace('downlevelTextBox','upLevelDiv');
var varCRUsernamevalue= NWF$('#' + newCRUsername).find('span.ms-entity-resolved').attr('title');
var lists = new SPAPI_Lists('');
var userprofiles= new SPAPI_UserProfile('');
var currentUserProfile = getUserProfileInfo(userprofiles,varCRUsernamevalue); 
var userFullName = getFullName(currentUserProfile);
//alert('UserFullName  '+userFullName);
//var varCurrentUser = clientContext.get_web().currentUser();
//var accountname = currentUser.get_title();
//console.log("accountname --> " + accountname);
var camlQuery = new SP.CamlQuery();
/* Use a CAML query to filter your results */
camlQuery.set_viewXml( +userFullName+ );

//camlQuery.set_viewXml('' + userFullName + '' + (new Date()).getFullYear() + '');
/* get the list item collection from the list */
        var oListItems = oList.getItems(camlQuery);
/* tell SharePoint to load the list items */
clientContext.load(oListItems);
  
//var LeaveType=NWF$("#" + JSLeaveType).val();   
var LeaveType=NWF$("#" + JSLeaveType + ' option:selected').text(); //Nintex form control is lookup field then get selected text
//clientContext.load(ListItem,'Include(AnnualLeave)','Include(MedicalLeave)'); 
/* execute the query to get the loaded items */

    clientContext.executeQueryAsync(
        /* onSuccess Function */
        Function.createDelegate(this, function () {
            /* 
            now that the query has run, you can get an enumerator 
            from your list item collection 
            */
            var arrayListEnum = oListItems.getEnumerator();
            var ids = [];
            while (arrayListEnum.moveNext()) {
console.log("New Inside While array loop");
//console.log(arrayListItem.get_current());
var listItem = arrayListEnum.get_current();
console.log(listItem.get_item('Title'));
console.log(listItem.get_item('AnnualLeave'));
console.log(listItem.get_item('MedicalLeave'));
//var varLeaveTypeName = NWF.RuntimeFunctions.parseLookup(NWF$('#'+JSLeaveType).val(),true); // Not working
var varLeaveTypeName =NWF$('#'+ JSLeaveType + ' option:selected').text();
console.log("varLeaveTypeName with Space  "+varLeaveTypeName);
varLeaveTypeName=varLeaveTypeName.replace(/\s+/g, ''); //Remove Space Javascript varaible
console.log("varLeaveTypeName without space "+varLeaveTypeName);
var varLeaveBalance = listItem.get_item(varLeaveTypeName);
console.log(varLeaveBalance);
            }
//console.log("Outside While array loop");
            
        }),
        /*onFailure Function*/
        Function.createDelegate(this, function (sender, args) {
            alert("Whoops: " + args.get_message() + " " + args.get_stackTrace());
        })
);
 }
catch(e)
{
alert("EmployeeLeaveBalance ERROR is " + e);
}
 }