ค้นหาเว็บไซต์

ตรวจสอบว่าแอปพลิเคชันบริการทำงานใน SharePoint โดยใช้ PowerShell หรือไม่


ถ้าคุณเป็นผู้ดูแลระบบ SharePoint อาจมีบางครั้งที่คุณต้องตรวจสอบว่าแอปพลิเคชันบริการกำลังทำงานอยู่หรือไม่ ในกรณีของฉัน สองครั้ง ฉันต้องได้รับสถานะของแอปพลิเคชันบริการก่อนที่จะดำเนินกิจกรรมต่างๆ เช่น: หยุดและเริ่มบริการ การตรวจสอบความพร้อมใช้งานของแอปพลิเคชันบริการ ฯลฯ โพสต์ในบล็อกนี้จะแสดงวิธีใช้ PowerShell เพื่อตรวจสอบว่า แอปพลิเคชันบริการกำลังทำงาน (หรือไม่) ใน SharePoint

สคริปต์ PowerShell เพื่อตรวจสอบสถานะของแอปพลิเคชันบริการ:

นี่คือวิธีที่เราสามารถตรวจสอบว่าแอปพลิเคชันบริการถูกสร้างและทำงานโดยใช้ PowerShell หรือไม่


Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Display Name of the Service Application
$DisplayName="Managed Metadata Services"

#Get the Service Application from its Name
$ServiceApp = Get-SPServiceApplication | Where { $_.DisplayName -eq $DisplayName}
    
if($ServiceApp -ne $null)
{
 #get the Service application status
 $ServiceApp.Status
}
else
{
 Write-Host "Service application either not found or not created!"
}

สคริปต์นี้ให้สถานะปัจจุบันของแอปพลิเคชันบริการ คุณยังสามารถรับแอปพลิเคชันบริการจากประเภทนั้นได้ นี่คือวิธีการ:


#Type Name of the Service Application
$TypeName="Managed Metadata Service"

#Get the Service Application from its Type Name
$SeviceApp = Get-SPServiceApplication | Where {$_.TypeName -eq $TypeName}

นี่คือชื่อประเภทของแอปพลิเคชันบริการทั้งหมด:

Type Name
Access Services Web Service Application
Access Services 2010 Web Service Application
App Management Service Application
Application Discovery and Load Balancer Service Application
Business Data Connectivity Service Application
Excel Services Application Web Service Application
Machine Translation Service
Managed Metadata Service
PerformancePoint Service Application
PowerPoint Conversion Service Application
Search Administration Web Service Application
Search Service Application
Secure Store Service Application
Security Token Service Application
State Service
Usage and Health Data Collection Service Application
User Profile Service Application
Visio Graphics Service Application
Work Management Service Application
Word Automation Services

บทความที่เกี่ยวข้อง