Wednesday, February 19, 2014

Deploy MSI-package from GPO

To deploy msi package to from GPO.

1. Create GPO DeployPackage

a. User Configuration>Policies>Software Settings>Software Installation

b. Create new package, choose msi to deploy. Must be located on a shared folder that has read permissions for authenticated users (to include all domain computers).

c. Choose Published

d. Choose newly created package, Change Deployment>Deployment Type to Assigned and Check Deployment options>Install this application at logon

2. Deploy this GPO to an OU where the User object is located.

3. GPUpdate /force on both server and client.

4. If all works, the client will notice the policy and request a restart.

5. Package should deploy as soon as logged in.

image

Friday, February 14, 2014

Thursday, February 13, 2014

Word with values from Document Library Columns

 

  1. Upload Wordtemplate to documentlibrary
  2. Create Site Content Type
  3. Advanced Settings > Enter url of wordtemplate in documentlibrary
  4. Associate site content type with your documentlibrary
  5. Edit Word Template in documentlibrary
  6. In Word, Insert > Quick Parts > Document Property >
  7. Choose your list columns, should be at the bottom.Place in wordtemplate at your leisure.
  8. Now, when creating new template from this Site Content Type the field will be automaticly populated with the columns values.

Using folders as metadata-masters

A handy feature to use when bulk-uploading documents to Sharepoint is the “Default Column Value”. This feature shines when using folders.

For example, say $user wants to upload 2000 images to an assetlibrary and wants to tag these with managed metadata values, 3 of them for a third of the lot and something else for the rest. Managed metavalues can’t be edited in datasheet view when using multiple values so this might take some time for $user.

In this case $user could create three folders in the assetlibrary and from Library Settings>Column Default Values > Folder  change the values as $user wants.

image

Now all documents copied to this folder, even from ExplorerView, will get these default values. Unless manually specifying something else.

The cool thing is that when the values have been set, $user can copy the images elsewhere in the documentlibrary and the metadata will still be attached. So folders can be used as a transitstation for settings metavalues. Or just be presented with a flat structure in the view.

References:

http://social.technet.microsoft.com/wiki/contents/articles/11301.sharepoint-2010-bulk-metadata-tagging.aspx

Friday, February 07, 2014

Alerts not working for some users

Nuisance mayor.

A client had an issue with alerts not working for some users.

image

Sorry something went wrong. The following users do not have an e-maildress specified:

Turned out email issues overall for these users.

Tried did not succed.

  • Restarted Server
  • User Profile Sync new full
  • Removed failing users profile from User Profiles and did a new full sync.
  • Changed settings for email in AD, synced verified changes where coming through. Changed back, still same issue.

Success:

Tried running />get-spuser –web http://myserv | select userlogin,displayname,email 

Noted that email was missing for the difficult users. Now why is that?

Verifed that Replicable was activated on the User Profile Properties settings for the emailfield. All looked good.

Fixed it by running :

/>$myuser = get-spuser –web http://myserv |?{$_.displayname –like “*myuser*”}

/> set-spuser –identity $myuser –web http://myserv –SyncFromAD

To identify accounts with no email

/> get-spuser –web http://myserv | where {-Not $_.email} |select userlogin,email

To output add |export-csv myusers.txt

Conclusions:

External client weren’t so interrested in putting in more time to figure out exactly what was wrong in the first place. New users for example are adding their email field from the AD without any issues. The problem users were added to the site prior to defining the email attribut in the AD so that may have been an issue aswell. Im still fidning it odd that the email were looking like they should in the User profile Services but not when using powershell. might be that the user profile service is making a lookup in the AD when browsing the profiles, but can’t be sure .

Solution found. Cause unknown. ill revisit this later.

References:

http://social.technet.microsoft.com/wiki/contents/articles/13771.troubleshooting-steps-for-sharepoint-alert-email-does-not-go-out.aspx

http://www.sharepointdiary.com/2012/02/sharepoint-alerts-not-working-troubleshooting-checklist.html#ixzz2aSvOz3hB

http://patrikluca.blogspot.se/2008/06/alerts-not-working-for-some-users-on.html

http://blogs.msdn.com/b/tehnoonr/archive/2009/10/13/sharepoint-alerts-emails-don-t-work-on-some-vmware-systems.aspx?Redirected=true

http://www.stuartroberts.net/index.php/2013/07/10/user_profile_sync/#more-1488 – email not available efter moving user

http://sharepointpratik.blogspot.se/2013/03/the-following-users-do-not-have-email.html

http://blogs.technet.com/b/steve_chen/archive/2009/11/20/alerts-in-sharepoint-troubleshooting-moss-wss.aspx

http://blogs.technet.com/b/harikumh/archive/2008/05/25/troubleshooting-alerts.aspx

http://www.harbar.net/archive/2011/02/10/account-deletion-and-sharepoint-2010-user-profile-synchronization.aspx

http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx

http://community.rightpoint.com/blogs/viewpoint/archive/2010/08/26/the-truth-about-how-daily-sharepoint-alerts-actually-work.aspx

http://social.technet.microsoft.com/Forums/sharepoint/en-US/b671a6c8-3065-4299-b7be-d40e9c5d982b/alert-me-error?forum=sharepointgenerallegacy Tells us email must be added prior to adding user to sp.

http://social.technet.microsoft.com/Forums/sharepoint/en-US/7c3947b9-c675-444c-b325-23185282eb74/user-email-not-updating-with-sharepoint?forum=sharepointadminprevious

Wednesday, February 05, 2014

Schedule a powershell script

When certain task has run, its nice to be notified. since email function is deprecated in taskscheduler we have to pull out powershell.

image

1. Create the script

-------sendmail.ps1-----

param([string]$task)
$psemailserver = "smtp.mycompany.com"
$receiver = john.doe@company.com
$from = task@company.com
$subject = "Task has run"
$body = "Scheduled task $task has run. "
send-mailmessage -to $receiver -from $from -subject $subject -body $body
write-host "Mail sent for $task"
write-eventlog -logname Application -source "my script" -entrytype information -eventid 1 -message "$task has run"
------eof----

2. Create the call using Task Scheduler “powershell –file “c:\myfile\sendmail.ps1” “helloworld”

What the script does is take an input variable and sending an email using defined smtpserver in the script. When mail is sent, it also logs en event in the application eventlog with source “my script”. The param is optional, but helpful if you want more reusability.

The source needs to created the first time manually, or use an already existing source.

Create source “my script” in application

/>New-eventlog –logname application –source ”my script”

References:

http://blogs.technet.com/b/heyscriptingguy/archive/2013/06/20/how-to-use-powershell-to-write-to-event-logs.aspx

http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx

http://stackoverflow.com/questions/16426688/passing-a-variable-to-a-powershell-script-via-command-line

Thursday, January 30, 2014

Local SMTP with Sharepoint 2013

Sharepoint isn’t very flexible when it comes to email server.

Enter the local smtpserver.

  1. Install SMTPServer
  2. Configure SMTP-Service using IIS6.0 Management Tools
    1. Access>Relay image
    2. Delivery>Outbound Security>basic authentication image
    3. Delivery>Outbound Connection> Specify TCP port
    4. Delivery>Advanced image
    5. All OK.
  3. Configure Centralt Administration>Web Application> Outgoing email = myserver.mydomain.local

It should work immediatly. No need to reset IIS or restart the smtpserver.

Sometimes youre mailing servers you cant verify settings on. Then Gmail can be used to verify the mailflow.

For google

  • Basic Authentication = myaccount@gmail.com , pwd: mypassword, use TSL
  • Use TCP port 587
  • Smarthost = smtp.gmail.com

To check email flow on local server, drive:\inetpub\mailroot\queue folder can be monitored. When mail is sent from sharepoint ,it lands in this folder while contacting the smtpserver. When there’s a problem, the mail will be stuck here. In some situations it might be needed to empty this folder, then content in this folder can be deleted if the iisadmin service first is stopped.

/>stop-service iisadmin

/>start-service iisadmin

/>start-service smtpsvc

References:

http://blogs.technet.com/b/yashgoel-msft/archive/2012/10/26/configuring-outgoing-email-settings-in-sharepoint-with-gmail-smtp.aspx

Powershell and Uptimerobot

Uptimerobot can be quite tedious when you need to update many monitors at once. For example say you bought the license for Uptimerobot and n...